Coder Social home page Coder Social logo

jgarte / py-web-tool Goto Github PK

View Code? Open in Web Editor NEW

This project forked from slott56/py-web-tool

0.0 1.0 0.0 424 KB

pyWebTool supports Literate Programming by trying to work with ANY markup language and any programming language

Home Page: https://slott56.github.io/py-web-tool/pyweb.html

License: BSD 3-Clause "New" or "Revised" License

CWeb 20.63% CSS 0.21% HTML 71.11% Python 7.42% TeX 0.64%

py-web-tool's Introduction

pyWeb 3.0: In Python, Yet Another Literate Programming Tool

Literate programming is an attempt to reconcile the opposing needs of clear presentation to people with the technical issues of creating code that will work with our current set of tools.

Presentation to people requires extensive and sophisticated typesetting techniques. Further, the "narrative arc" of a presentation may not follow the source code as layed out for the compiler.

pyWeb is a literate programming tool based on Knuth's Web to combine the actions of weaving a document with tangling source files. It is independent of any particular document markup or source language. Is uses a simple set of markup tags to define chunks of code and documentation.

The pyweb.w file is the source for the various pyweb module and script files. The various source code files are created by applying a tangle operation to the .w file. The final documentation is created by applying a weave operation to the .w file.

Installation

python3 setup.py install

This will install the pyweb module.

Document production

The supplied documentation uses RST markup and requires docutils.

python3 -m pyweb pyweb.w
rst2html.py pyweb.rst pyweb.html

Authoring

The pyweb document describes the simple markup used to define code chunks and assemble those code chunks into a coherent document as well as working code.

If you're a JEdit user, the jedit directory can be used to configure syntax highlighting that includes PyWeb and RST.

Operation

You can then run pyweb with

python3 -m pyweb pyweb.w

This will create the various output files from the source .w file.

  • pyweb.html is the final woven document.
  • pyweb.py, tangle.py, weave.py, README, setup.py and MANIFEST.in
    .nojekyll and index.html are tangled output files.

Testing

The test directory includes pyweb_test.w, which will create a complete test suite.

This weaves a pyweb_test.html file.

This tangles several test modules: test.py, test_tangler.py, test_weaver.py, test_loader.py and test_unit.py. Running the test.py module will include and execute all tests.

cd test
python3 -m pyweb pyweb_test.w
PYTHONPATH=.. python3 test.py
rst2html.py pyweb_test.rst pyweb_test.html

py-web-tool's People

Contributors

ad-hom avatar slott56 avatar vo1stv avatar wvwhome avatar

Watchers

 avatar

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.