Publish/Examples

From J Wiki
Jump to navigation Jump to search
Publish | Overview | Markup Summary Markup Detail | Styles | Images Tables | Examples

Example: demo

The Publish addon includes a simple example in directory:

   jpath '~addons/format/publish/demo'

To try this out, after installing the addon:

   load 'format/publish'
   publish '~addons/format/publish/demo/master.txt'

If you have defined a PDF reader in your config, this will display the file master.pdf that will be created.

Example: findemo

The file File:Findemo.pdf was generated by Publish. The source for this file is in the Addons repository, at findemo.

To try this out, checkout the source. Update the PUBPATH definitions in plot.ijs and table.ijs as appropriate, then run:

   load 'format/publish'
   publish 'c:\findemo\master.txt'     NB. use correct directory

Example: source files

Here are examples of typical source files:

File: master.txt

<title>Publish</title>
<author>Peter Simple</author>
<include>front.txt</include>
<include>section1.txt</include>
<include>section2.txt</include>

File: section1.txt

<h1 name="Section 1">SECTION 1</h1>
<h2>Subsection 1 - Plain Text</h2>

Alice had never been in a court of justice before, but she had
read about them in books, and she was quite pleased to find that
she knew the name of nearly everything there. `That's the judge,'
she said to herself, `because of his great wig.'

<h3>Subsubsection 1</h3>

Example of table, built in J:
<j>gettable 'tab11'</j>

<h3>Subsubsection 2</h3>

Example of image:
<image align=center,scale=0.2>map.jpg</image>