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

feat: skip over unknown directives #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

3-w-c
Copy link

@3-w-c 3-w-c commented Jan 14, 2022

Fixes #14, #15

This is my first contribution to anything RST, so it might not be the best approach 😅

Test file:

######################
 Prior research
######################

According to :cite:t:`nutt2009`

Before this PR:

docutils.utils.SystemMessage: :16: (ERROR/3) Unknown interpreted text role "cite:t".

After this PR:

  • :cite:p: kept as-is 🥳

Future enhancement could be to output warnings, maybe?

@jdillard
Copy link

jdillard commented Jan 29, 2023

I tested out this branch and it does a great job of skipping roles, but it seems to remove unknown directives. Example:

-Current contributors
---------------------
-
-Thanks to all who have contributed!
-The people that have improved the code:
-
-.. contributors:: jdillard/sphinx-sitemap
-    :avatars:
-    :order: ASC
+**********************
+ Current contributors
+**********************
 
+Thanks to all who have contributed! The people that have improved the
+code:

So a great step in the right direction, but currently destructive until the directive issue is fixed.

The scope of the PR could also be changed to just skipping over unknown roles if lines 268-269 are commented out, and support for skipping directives could come later.

@FlorianSchwahofer
Copy link

FlorianSchwahofer commented Nov 24, 2023

Hi @dzhu ,

do you have any ideas how one could enable a handling of custom directives to support them in the formatter? I'm not really familiar with the docutils parser...

Thanks and best regards!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tolerate Sphinx extensions
3 participants