Webpages Generator

wpgen (1) faq (3)
Dmitry Shachnev

ReText Webpages Generator (WpGen) is an useful tool for generating html pages to use on your web site.

It's possible to use WpGen directly from ReText 0.7+. Also, a command-line interface is available.

Using via the GUI

  1. Save some documents in one directory and open one of them in ReText
  2. Select "File → Directory → Generate webpages" in the menu

Using via the command-line tool

  1. Create an empty directory.
  2. Open a terminal at that directory and enter wpgen init to create neccesary files.
  3. Create the pages in that directory. Both Markdown and ReST pages are supported. index.mkd page is used as the home page.
  4. Run wpgen updateall to create ready-to-use HTMLs. You can also use wpgen update PAGENAME to process only one page.
  5. You can specify some Markdown extensions that your website needs in markdown-extensions.txt file of WpGen's working directory; separate them using a line break.

Customizing the look

To customize the look, edit the html/style.css file. You can also use some built-in CSS styles by entering wpgen usestyle %Style%. By default, WpGen comes with three themes: "Simple", "Default" (grey-colored) and "Blue".

To customize page layout, edit the template.html file.

Note: if command wpgen does not work (for example, if you have downloaded retext from here), replace it with the full path to wpgen.py file.

Also, if wpgen init doesn't work, run it from the wpgen/ directory first, and the copy pages/, html/ directories and template.html file to another directory.

  • Anonymous



  • Anonymous

    The only thing in my File -> Directory menu is Show. Using version 2.1.4 of ReText

    • Which OS are you using? You should have WpGen installed in either WORKING_DIR/wpgen/wpgen.py or /usr/bin/wpgen.


  • Anonymous

    When exporting to HTML using WpGen, all the Markdown extensions are ignored. Could you modify the process to include your own export to HTML before sending it to WpGen, that way the extensions are processed? Would love to hear if that is possible.

    Thanks, great software!

    • Added extensions support to WpGen, now you can specify them in markdown-extensions.txt file (updated this page with more information). I don't think it's worth using ReText's own extensions list, because sets of extensions may differ between websites.


      • Anonymous

        Great! thanks for the effort. I look forward to using this feature.



Cancel   Add attachments