How to use sphinx-prompt - 2 common examples

To help you get started, we’ve selected a few sphinx-prompt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sbrunner / sphinx-prompt / sphinx-prompt / __init__.py View on Github external
if prompt in self.prompts:
            return ''
        else:
            index = self.next_index
            self.next_index = index + 1
            self.prompts[prompt] = index
            return """span.prompt{0:d}:before {{
  content: "{1!s} ";
}}
""".format(index, prompt)

    def get_prompt_class(self, prompt):
        return 'prompt{0:d}'.format(self.prompts[prompt])


cache = PromptCache()


class PromptDirective(rst.Directive):

    optional_arguments = 3
    has_content = True

    def run(self):
        self.assert_has_content()

        language = 'text'
        prompt = None
        modifiers = []

        if self.arguments:
            language = self.arguments[0]
github sbrunner / sphinx-prompt / sphinx-prompt / __init__.py View on Github external
def setup(app):
    app.add_directive('prompt', PromptDirective)
    app.connect('env-purge-doc', cache.clear)
    return {
        'parallel_read_safe': True,
        'parallel_write_safe': True,
    }

sphinx-prompt

Sphinx directive to add unselectable prompt

BSD-3-Clause
Latest version published 3 months ago

Package Health Score

70 / 100
Full package analysis

Similar packages