Code Monkey home page Code Monkey logo

regendoc's Introduction

regendoc

re-render examples in documentation

regendoc copies examples from documentation into custom folders and renders it

.. code:: python

   # content of example.py

   def test_fun():
      pass


.. code:: text

   $ pytest example.py
   ============================= test session starts ==============================
   platform linux -- Python 3.9.7, pytest-6.3.0.dev685+g581b021aa.d20210918, py-1.10.0, pluggy-1.0.0
   rootdir: /path/to/example
   plugins: hypothesis-6.14.8
   collected 1 item

   example.py .                                                             [100%]

   ============================== 1 passed in 0.01s ===============================

regendoc's People

Contributors

blueyed avatar flub avatar hpk42 avatar nicoddemus avatar ronnypfannschmidt avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

regendoc's Issues

stip line endings

leaving them as is is incompatible with the pre commit whitespace fixing in pytest

Add a way to ignore $ lines without uglifying the docs

Currently, regendoc runs all commands from docs that start with $:

elif first[0] == "$":
cmd = first[1:].strip()
return at("shell", cmd)

In order to workaround this feature, the commands not desired regenerating are prepended with extra charters (such as . or #) in pytest documentation. This works (such lines are not regenerated), however such characters remains in the rendered HTML docs and are visible to the reader.

See pytest-dev/pytest#5153

A better way (invisible to the user) to mark code snippet as skip-regenerating should probably be invented. A rst comment or directive might do.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.