Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code snippet features to match features from sphinx literalinclude directive #189

danroth27 opened this issue Mar 4, 2016 · 1 comment


Copy link

@danroth27 danroth27 commented Mar 4, 2016

When using Sphinx to build documentation you can use the literalinclude directive to include code snippets from a separate file. DocFX flavored markdown supports something similar with code snippets, but it looks like it is missing a few features that we use heavily in the ASP.NET docs:

  • Ability to specify multiple line number ranges and to skip lines:
.. literalinclude::
   :lines: 1,3,5-10,20-
  • Options to display line numbers when the code is rendered and to emphasize specific lines when the code rendered:
.. literalinclude:: example.rb
   :language: ruby
   :emphasize-lines: 12,15-18
  • Ability to dedent the rendered code so that it is correctly aligned with the rest of the content instead of having extra leading whitespace:
.. literalinclude:: example.rb
   :language: ruby
   :dedent: 4
   :lines: 10-15
Copy link

@superyyrrzz superyyrrzz commented Apr 18, 2016

Support highlight lines in code snippet in 27e88f3

superyyrrzz added a commit that referenced this issue Apr 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.