Is there a way to support custom directives?
See original GitHub issueIt’d be very nice to be able to translate custom directives, like a .. video::
one I’ve created for my doc.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
How to use and create custom directives in Angular
There are a lot of built-in Directives available in Angular which you can easily use. In this section, we will use two very...
Read more >Creating schema directives - Apollo GraphQL Docs
Supported locations. Your custom directive can appear only in the schema locations you list after the on keyword in the directive's definition.
Read more >Using Custom Directives with Apollo Federation
Yes! We can define a custom directive in an implementing service and apply it to a field for a type that has been...
Read more >Using a Custom Directive | Pluralsight
Hello friends, In this guide, we're going to learn about custom directives. In Angular, directives play an important role. There are many ...
Read more >support custom directives in federated schemas · Issue #145
The filtered directives in the line you're referencing are used to print the directive declarations like directive @foo on FIELD_DEFINITION . It ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can have a look at https://www.sphinx-doc.org/en/master/development/tutorials/todo.html to see a little example. The link you posted above ( https://github.com/ankita240796/docs/blob/f57ebfbb3dc82b256334efbf6a697ef612b36890/video.py ) is another example.
Inside a Sphinx extension, you define a new directive that will create a new type of node inside the document tree. Thus, you also define a new node class in the extension. Of course, you now have to explain how you would transform this new type of node into HTML, Latex or, here, Markdown. So, you write several “functions” that can transform this type of node into an output format. These functions will be dynamically weaved into a node visitor as visit / depart methods (so you need a visit function and a depart function and you have to be compliant with the node visitor internal behaviour). When you register the new type of node in the Sphinx application with the
add_node
method, you also give the visit / depart functions for each format you want to support.In the “todo” tutorial, this is what is done for the
todo
node. In the “video” example, this is also what is done for thevideo_node
.That seems nice but I don’t really get all the possibilities? Will you provide some code examples?