Welcome to Writeup.org

Writeup is a scripting language for documents, making it fast, easy and fun to create documents for the web, for print, or for slide presentation, or all three at once from the same original document.

See the Quick Reference guide for more details!

How to optionally incude content

//.Selection of stories for //date will be added
$VER=2.90
$MDATE=2019-07-25 // only content that matches this date will be included
...$TITLE _$MDATE _
$include incstd.txt
$command=writeup -y $FILENAME // turn html into pdf file using wkhtmltopdf2
$command+= && wkhtmltopdf2 $pdfopt $FILE.html $FILE.pdf && rm $FILE.html
$pdfopt=-s Letter -L 10 -R 10 -T 10 -B 10 --zoom .9

$instory=TRUE
$estory=
$endstories=!!>
$story($sdate, line $title)={
  $if !$instory||!!>||$endif
  $if $MDATE==$sdate
    $instory=TRUE
    ..$title
  $else
    $instory=FALSE
    <!!
  $endif
}

Six ways of assigning a value after an operation already done:

  1. The older way: $set $x=3.3 $mult 3 gives the value 9.899999999999999
    • not very readable
  2. The long way: $set $x=3.3 $modify($x).mult(3) gives the value 9.899999999999999
  3. The trick way: $set $x=$NULL.plus(3.3).mult(3) gives the value 9.899999999999999
  4. The newer way: $setval $x=$mkvar(3.3).mult(3) gives the value 9.899999999999999 (have to use $setval for now)
    • more readable, even though slightly longer
  5. The future way: $set $x=$mkvar(3.3).mult(3) gives the value 9.899999999999999
  6. Future compact way having first defined $V function as $V=$mkvar($V_val)||$parameters $V V_val
    Use this with: $set $x=$V(3.3).mult(3) gives the value $V(3.3).mult(3)
    • Good if code needs to be compact

Four ways of printing a value with an operation already done on it:

  1. The older way: $( 33.3 $mult 3 $) gives the value 99.89999999999999
    • not very readable
  2. The long way: $set $x=33.3 $x.mult(3) gives the value 99.89999999999999
  3. The trick way: $NULL.plus(33.3).mult(3) gives the value 99.89999999999999
  4. The newer way: $mkvar(33.3).mult(3) gives the value 99.89999999999999
    • more readable, even though slightly longer
  5. Future compact way having first defined $V function as $V=$mkvar($V_val)||$parameters $V V_val
    Use this with: $V(3.3).mult(3) gives the value 9.899999999999999 33.3
    • Good if code needs to be compact

Printing a variable only if it exisits

If a variable does not exist, then printing it produces an error. There are several methods of getting around this.

  • We will start by setting $hasval to Has a Value, and not setting $noval
  • Our test line will be: Testing ($noval) and ($hasval)

Version 2.51 Released

Writeup version 2.51 has just been released on

As well as a few minor bug fixes, there is a new option: -c --close which will silently close open tags at the end of a document.

This is important for the Drupal integration project since teasers are usually created by chopping off much of the document, and so possibly creating some unclosed structures.

Version 1.5 of the Drupal project integrates with Writeup vers

Writing a Factory Function

A factory function creates other functions.

  • Suppose we want a function that creates links to Drupal project pages. It will allow us to refer to the project writeup using $writeup by creating the definition:
    $writeup=[[https://www.drupal.org/project/writeup writeup]]

Exploring the different kind of assignments

  1. Whole-line assignments $x=value
    Note that any quotations will not be removed but included as part of the value
  2. Inline assigments using $set $set $x=value
  3. Inline assigments using $set $set $x="value" with value in quotations
  4. Inline assigments using $setval $setval $x=value with or without quotations
  • If the assigned value does not contain variables that can be evaluated, then all three methods produce identical answers.

A. the assigned value is a single variable

$a=A-value

Writeup 2.4 released

Finally, after months of developing and testing, a new stable version of Writeup has been released: Writeup 2.4.

Get it at sourceforge in Linux, Mac and Windows versions.

  • The whole underlying processing of functions has been refactored to remove some of the earlier limitations.
  • Plus the keywords system increases the power of Writeup immensely.

For a full list of changes, see the changelog.

Another RC for Writeup 2.0 released

A new release candidate for Writeup 2.0 (1.99.16) is now available at sourceforge in Linux, Mac and Windows versions.

  • The main change, as well as a few bug fixes, is better microdata support for time. Previously dates were supported, but now there is good support for time, both as microdata and in the <time> tag.

For a full list of changes, see the changelog.

  • The documentation continues to be improved, although it should probably no longer be called “quick reference” but “full reference”.

Release Candidate of Writeup 2.0 includes a Mac verision

The release candidate for Writeup 2.0 has been released on sourceforge. See sourceforge.net/projects/writeup/files/ for the download page. New features kept creeping in and delaying the release, but this looks good.

The Drupal module for allowing Writeup to be an input filter is now stable. See drupal.org/project/writeup.

Syndicate content