doc-builder
doc-builder copied to clipboard
Additional directives that would make development easier
The following directives would have been helpful when working on huggingface_hub:
- A directive to specify in which version it was added (equivalent of versionadded)
- A directive to specify in which version it was changed (equivalent of versionchanged)
- A directive to specify it is deprecated (equivalent of deprecated)
Other directives I find usefule:
literalincludetabularcolumnsnotewarning
@LysandreJik Please let me know what kind of syntax you'd like?
How does <xyz number> look? (ex: <versionadded 2.5>, <deprecated 3.1>) ?
@adrinjalali
for note, we have similar <Tip> object that looks like this:

for warning, we have similar <Tip warning> object that looks like this:

for tabularcolumns , since .mdx files support both markdown & html, one can supply markdown or html table (with its custom styles)
for literalinclude, I don't have a good idea on how it should be done (cc: @sgugger )
It doesn't look like we can easily do everything literalinclude does in just one command. What was the most useful feature you wanted @adrinjalali ? Highlighting lines? Showing line numbers?
literalinclude is useful when you have python examples (a .py file) and then you want to reference a section of that in a user guide (an .mdx file). It's only useful once we have the "compile a .py into an .mdx" kinda thing working.
Indeed, I've found literalinclude being used quite a lot in tokenizers docs as in here
What was the most useful feature you wanted
the feature that is being used in tokenizers is:
.. literalinclude:: ../../bindings/node/examples/documentation/pipeline.test.ts
:language: javascript
:start-after: START setup_pre_tokenizer
:end-before: END setup_pre_tokenizer
:dedent: 8
This
How does
look? (ex: <versionadded 2.5>, <deprecated 3.1>) ?
looks good to me!
@mishig25 are versionadded, versionchanged and deprecated already integrated?
@albertvillanova no. But I'll add them by tomorrow 😊