4

I'm currently deciding whether to migrate my developer docs from Sphinx to Docusaurus. The one thing that's holding me back is that Docusaurus (and in fact Markdown in general) doesn't support pulling specific lines of text from other files.

Sphinx (reStructuredText) allows you to include text between a start-after and end-before marker on another file - so really useful for pulling in code snips from fully functioning scripts:

.. include:: ./scripts/matts_script.py
   :start-after: # marker_1
   :end-before: # marker_2

So is there a way of doing this in Docusaurus? Has anyone done it? I'm thinking maybe levaraging MDX and JSX but that's really just a guess.

mzjn
  • 48,958
  • 13
  • 128
  • 248
kenna
  • 51
  • 1

0 Answers0