diff options
author | rsiddharth <rsiddharth@ninthfloor.org> | 2012-12-21 19:22:18 +0530 |
---|---|---|
committer | rsiddharth <rsiddharth@ninthfloor.org> | 2012-12-21 19:22:18 +0530 |
commit | 2e4c16423963bdf137ccebc66109afa14eb6672c (patch) | |
tree | 17f557b011c3a92bfca0b6068a7ac14db76e6de3 /docs | |
parent | 5e645c43fba0160feae7993d0ea6f8687f65238d (diff) |
started writing the README file; added .html files in docs/
removed:
docs/scruf
added:
README
docs/scruf-howto.html
docs/scruffy-markup.html
modified:
etc/TODO
Diffstat (limited to 'docs')
-rw-r--r-- | docs/scruf | 88 | ||||
-rw-r--r-- | docs/scruf-howto.html | 258 | ||||
-rw-r--r-- | docs/scruffy-markup.html | 298 |
3 files changed, 556 insertions, 88 deletions
diff --git a/docs/scruf b/docs/scruf deleted file mode 100644 index 63f0b3e..0000000 --- a/docs/scruf +++ /dev/null @@ -1,88 +0,0 @@ -scruf - documentation - -========== -scruf - documentation -========== - - ''scruf'' is a simple program that converts text marked-up in -''scruffy'' mark-up to HTML5 files. It was written specifically for -generating blog posts. The way ''scruf'' works is straight forward -- -it takes in directory and converts all the ''scruffy'' marked-up -plain-text files into corresponding HTML5 files. After the conversion, -''scruf'' puts links to the generated HTML5 files in the `index.html` -file of that directory. So, that's how ''scruf'' works. - -==================== -using scruf -==================== - -Before you plunge into learning about scruf and eventually using -it. Let me run you through the pre-requisites. - - '''Paraphernalia''': ''scruf'' is written in Java, therefore, you'll - need the `openjdk` package, inorder to be able to compile and run - scruf. Go ahead and install `openjdk` before proceeding - forward. Number two, ''scruf'' was written on a GNU/Linux machine, - so, it should work well on all Unix-based operating systems. - -Once, you have a copy of `openjdk` installed on your machine, you're -all set to start licking ''scruf''. Here we go. - -============================== -scruffy mark-up -============================== - -Inorder to convert plain-text files into HTML5 using ''scruf'', you -got to mark it up with the ''scruff'' mark-up, so that ''scruf'' -understands the elements of the plain-text document and duly converts -them into HTML5. As the name suggests ''scruffy'' mark is pretty -shabby when compared to cleaner mark-ups like -[[http://daringfireball.net/projects/markdown/|Markdown]]. ''scruffy'' -is inspired, to an extent, from [[http://moinmo.in/|MoinMoin]] & -[[http://www.mediawiki.org/wiki/MediaWiki|MediaWiki]] syntax. - - -======================================== -basic structure -======================================== - -The ''scruffy'' plain-text document that is going to be converted by -''scruf'', follows a format and here it is: - -### - -title - -========== -foo heading -========== - -$$$ 1 January 1970 $$$ - -The bar blog post goes like this... -... -... -the bar blog post ends - ----------------------------------------------------------------------- -author's signature ----------------------------------------------------------------------- - -### - -The first line in the ''scruffy'' document __must__ always begin with -the text of the title of the document. The ''title'' is the string -that is going to be displayed on the browser tabs and for compliance -sake, it is recommended that it be same as the ''heading'' of the -''scruffy'' document. Followed by the ''title'' is the heading, then -the body of the post/essay/whatever and finally the author's -signature. This is the basic structure of a ''scruffy'' document. - - -======================================== -syntax -======================================== - -============================== -running scruf -============================== diff --git a/docs/scruf-howto.html b/docs/scruf-howto.html new file mode 100644 index 0000000..09eb543 --- /dev/null +++ b/docs/scruf-howto.html @@ -0,0 +1,258 @@ +<!DOCTYPE html> +<head> +<meta charset="UTF-8"> + <link rel="stylesheet" type="text/css" href="style.css" /> +<meta name="author" content=" rsiddharth"> +<title> scruf manual</title></head> +<body> +<article> + + + +<h1> scruf manual </h1> + +<h2> scruf </h2> + +<p> +scruf is a dirty, but minimalistic, program that spits out valid HTML5 +files from marked up plain text files. +</p> + +<h3> scruffy markup </h3> + +<p> +The markup that is understood by scruf is called <i>scruffy</i>. The +<i>scruffy</i> markup is inspired from +<a href="http://moinmo.in/HelpOnMoinWikiSyntax">MoinMoin's markup</a>. +</p> + +<p> +To learn about the syntax and details about the <i>scruffy</i> markup, +take a look at the <a href="./scruffy-markup.html">documentation page</a> of +<i>scruffy</i> markup. +</p> + +<h2> how scruf works </h2> + +<p> +The way scruf works is darn straightforward. You give it a directory +and it recursively checks for <i>scruffy</i> marked up files and converts +them into valid HTML5. +</p> + +<p> +In each directory that contains <i>scruffy</i> marked up files, scruf +automatically creates an <span class="monospace">index.scruffy</span> file and a corresponding +<span class="monospace">index.html</span>,to which it appends links to all the HTML5 files that it +has converted. +</p> + +<p> +scruf provides its own style sheet which is placed in each directory +that has HTML5 files produced by scruf. +</p> + +<h2> using scruf </h2> + +<p> +At present, scruf is cursed to only run on GNU/Linux based operating +systems. +</p> + +<p> +scruf is written in Java, therefore, there is a strong possibility +that it could work out of the box in Windows, Mac, etc. But, be aware +that it was never tested in platforms other than GNU/Linux, so there +is no assurance that it <i>will</i> work as it should on other platforms. +</p> + +<p> +To be able to use scruf, the <span class="monospace">openjdk</span> package is required, in order to +compile and run scruf. +</p> + +<h3> installing the jdk </h3> + +<p> +On a <a href="http://www.debian.org/">Debian</a> GNU/Linux based system, the JDK +can be installed with: +</p> + +<div class="code"><br /> # apt-get update<br /> # apt-get install default-jdk<br /></div> + +<p> +If the above <span class="monospace">install</span> command does not work, do: +</p> + +<div class="code"><br /> # apt-cache search jdk <br /></div> + +<p> +to find the appropriate package name for the JDK and then install the +package with: +</p> + +<div class="code"><br /> # apt-get install appropriate-package-name<br /></div> + +<p> +For installing the JDK on other GNU/Linux systems, take a look at +openjdk's <a href="http://openjdk.java.net/">homepage</a> for more information. +</p> + +<h3> compiling scruf </h3> + +<p> +You must compile scruf's source files, before it can be run to eat +your <i>scruffy</i> marked up files. +</p> + +<p> +Extract the tar archive and <span class="monospace">cd</span> to scruf's territory: +</p> + +<div class="code"><br /> $ tar -xvzf scruf-X.X.X.tar.gz<br /> $ cd scruf-X.X.X/<br /></div> + +<p> +The 'X's represent the version number of the scruf package. +</p> + +<p> +The compilation procedure is arduous at present, it will be made +simpler and nicer in the future to come. +</p> + +<p> +Here's how the source is compiled at present: +</p> + +<div class="code"><br /> $ javac scruf/*.java<br /> $ javac scruf/*/*.java<br /> $ javac scruf/*/*/*.java<br /></div> + +<p> +By now, scruf is cooked and read to be exploited by your sweet +hands. +</p> + +<h3> convert <i>scruffy</i> files to HTML5 </h3> + +<p> +To convert <i>scruffy</i> marked up files, <span class="monospace">cd</span> to the directory where +scruf is: +</p> + +<div class="code"><br /> $ cd /path/to/scruf-X.X.X/<br /></div> + +<p> +and do: +</p> + +<div class="code"><br /> $ java scruf.Run /path/to/scruffy-files-directory/<br /></div> + +<p> +scruf will convert the <i>scruffy</i> marked up files and place the +generated HTML5 files in the same directory where the <i>scruffy</i> +marked up files reside. +</p> + +<p> +The HTML5 files, generated by scruf, <u>must not</u> be manually edited, +if you wish to edit a HTML5 file, edit the corresponding <i>scruffy</i> marked +up file and generate the HTML5 files again by doing: +</p> + +<div class="code"><br /> $ java scruf.Run<br /></div> + +<p> +As is seen above, it is not required to give the path to the <i>scruffy</i> +files directory every time. scruf is intelligent enough to remember +the directory. So from the second time on, it is just enough to run +the program. +</p> + +<p> +When a directory is given to scruf, when it is invoked: +</p> + +<div class="code"><br /> $ java scruf.Run /path/to/directory<br /></div> + +<p> +It stores the absolute path of the directory in <span class="monospace">~/.scruf/list</span>. +</p> + +<p> +Every time, scruf is run: +</p> + +<div class="code"><br /> $ java scruf.Run<br /></div> + +<p> +it checks all the directories is the <span class="monospace">list</span> for new/modified <i>scruffy</i> +marked up files and converts them into HTML5. +</p> + +<h3> ignoring directories </h3> + +<p> +As previously mentioned, scruf recursively checks the given directory +to find <i>scruffy</i> marked up files. There will be times when it doesn't +make sense to let scruf loiter in sub-directories. It is possible to +tell scruf to ignore the respective sub-directories. +</p> + +<p> +To do this, create a <span class="monospace">.ignored</span> file in the respective directory and +list all the sub-directories that has to be ignored. The +sub-directories listed in <span class="monospace">.ignored</span> should be line seperated. +</p> + +<p> +For instance, if <span class="monospace">audio/</span>, <span class="monospace">video/</span>, <span class="monospace">images/</span> are the +sub-directories, that are to be ignored by scruf in the respective +directory. The <span class="monospace">.ignore</span> file, in this case, will look like this: +</p> + +<div class="code"><br />audio/<br />video/<br />images/<br /></div> + +<h2> Cascading Style Sheets(CSS) </h2> + +<p> +scruf places <span class="monospace">style.css</span> in each directory in which it finds a <i>scruffy</i> +marked up file. Feel free to edit & modify the style sheet. but please +remember not to change/remove the <u>names</u> of <span class="monospace">classes</span>, it may +mess up the formatting of all the HTML5 files that are dependent on the +style sheet. +</p> + +<p> +The <a href="./style.css">style.css</a> is valid CSS3. +</p> + +<h2> have problems? </h2> + +<p> +If there are/is any issue(s) with using scruf or understanding how it +works. Please subscribe & send an email to the +<a href="http://lists.nongnu.org/mailman/listinfo/scruf-friends">scruf-friends</a> +mailing list. That way we can solve your problem together. +</p> + + +<footer>a <i>scruffy</i> howto.</footer> + + + <div class="source"> + + <a href="./scruf-howto.scruffy">source</a> + </div> +<div class="back"> +<a href="./"> back </a> +</div> +</article> + +<div class="lastupdate"> + Last Updated on: 21 December, 2012</div> + +<div class="scruf"> +<a href="http://nongnu.org/scruf/">powered by scruf</a> +</div> + +</body> +</html> diff --git a/docs/scruffy-markup.html b/docs/scruffy-markup.html new file mode 100644 index 0000000..c367a5b --- /dev/null +++ b/docs/scruffy-markup.html @@ -0,0 +1,298 @@ +<!DOCTYPE html> +<head> +<meta charset="UTF-8"> + <link rel="stylesheet" type="text/css" href="style.css" /> +<meta name="author" content=" rsiddharth"> +<title> the scruffy markup</title></head> +<body> +<article> + + + +<h1> the scruffy markup </h1> + +<p> + <i>scruffy</i> is the markup that is understood by scruf. +</p> + +<p> +All <i>scruffy</i> marked up documents must have a <span class="monospace">.scruffy</span> extension +-- that is how scruf comes to know that a particular file is, indeed, +a <i>scruffy</i> document. +</p> + +<p> +The following sections will get you acquainted with the <i>scruffy</i> +markup. +</p> + +<h2> meta things </h2> + +<p> +First things first. At the beginning of the <i>scruffy</i> document, it +is required to specify some <span class="monospace">meta</span> things -- the document title & the +author of the document. +</p> + +<p> +This is how it is done. +</p> + +<div class="code"><br />meta-title: Title of Your Document<br />meta-author: Author<br /></div> + +<h2> document date </h2> + +<p> +To specify the date of creation of the document, surround the date +with a pair of <span class="monospace">$$$</span>. +</p> + +<div class="code"><br />$$$ 1 January, 1984 $$$<br /></div> + +<p> +It can be made verbose too. +</p> + +<div class="code"><br />$$$ Posted on 1 January, 1984 $$$<br /></div> + + +<h2> headings </h2> + +<p> +The mark-up for specifying the heading is the clumsiest of all. Now is +the time to hate <i>scruffy</i> for what it is. +</p> + +<p> +To specify a <h1> heading, surround the <i>heading string</i> with a pair +of <span class="monospace">10</span> equals sign(<span class="monospace">=</span>). +</p> + +<div class="code"><br />==========<br />Heading 1<br />==========<br /></div> + +<p> +For a <h2> heading, the <i>heading string</i> is surrounded by a pair of +<span class="monospace">20</span> equals sign. +</p> + +<div class="code"><br />====================<br />Heading 2<br />====================<br /></div> + +<p> +So the math is: +</p> + +<div class="code"><br />no of equals signs = ((heading size) * 10)<br /></div> + +<p> +For <h3> (head size is 3), the number of equals signs is equal to +30. Therefore, a to get a <h3> heading, the <i>heading string</i> should +be surrounded by a pair of <span class="monospace">30</span> equals signs. +</p> + +<h2> paragraphs </h2> + +<p> +Paragraphs are delimited by a blank line. +</p> + +<div class="code"><br />foo is good at drinking.<br /><br />bar loves to hack code.<br /></div> + +<p> +The above two lines are converted to: +</p> + +<div class="code"><br /><p> foo is good at drinking.</p><br /><br /><p> bar loves to hack code.</p><br /></div> + +<h2> word decoration </h2> + +<p> + <b>Bold</b> text is surrounded by three singles quotes(<span class="monospace">'''</span>). +</p> + +<div class="code"><br />'''This text will be in bold''' <br /></div> + + +<p> + <i>Italic</i> text is surrounded by two single quotes(<span class="monospace">''</span>). +</p> + +<div class="code"><br />''This text will be italicized''<br /></div> + +<p> + <u>Underlined</u> text is surrounded by two underscores (<span class="monospace">__</span>). +</p> + +<div class="code"><br /> __This text will be underlined__<br /></div> + +<p> +Text may be <span class="monospace">monopspaced</span> too, it is done by surrounding the text with +<span class="monospace">`</span> symbol. +</p> + +<div class="code"><br /> `monospaced text` <br /></div> + +<p> +If the beginning of the text, in a paragraph, is decorated, +then, please remember to <i>leave a space before starting the +paragraph</i>. +</p> + +<div class="code"><br /> ''This paragraph is'' decorated at the beginning with italics, <br />so, a space is left before starting the paragraph.<br /></div> + +<h2> code blocks </h2> + +<p> +When it is desired to illustrate code or show verbatim text, the text +or code is put around a pair of <span class="monospace">###</span>. +</p> + +<div class="code"><br /> ###<br /><br /> #include <beer.h><br /><br /> void main() {<br /> beer lager;<br /> lager.drink();<br /> return;<br /> }<br /><br /> ###<br /></div> + +<p> +Text inside code blocks <u>cannot</u> be marked up, as all special +characters are converted into their corresponding HTML number inside a +code block. +</p> + +<p> +All through this document, those grayscaled blocks of text are, +indeed, code blocks. +</p> + +<h2> block quote </h2> + +<p> +A block of text is <i>blockquoted</i> when it is surrounded by <span class="monospace">%%%</span> +string. +</p> + +<div class="code"><br />%%%<br /><br />The is phrase is fain to be blockquoted by scruf. <br /><br />%%%<br /></div> + +<h2> links </h2> + +<p> +The markup for links is very similar to +<a href="http://moinmo.in/HelpOnMoinWikiSyntax#Hyperlinks">MoinMoin's markup +for links</a>: +</p> + +<div class="code"><br /> [[http://en.wikipedia.org/wiki/Special:Random|Wikipedia Random Article]]<br /></div> + +<p> +As seen above, the <i>link block</i> is surround by <span class="monospace">[[</span> & <span class="monospace">]]</span>. The +first part inside the link block is the <i>link</i> and the second part +(which is optional) is a description of the link. The two parts of the +<i>link block</i> is separated by a <span class="monospace">|</span> (pipe) symbol. +</p> + +<p> +The pipe symbol (<span class="monospace">|</span>) is eliminated from the <i>link block</i>, if the +link description is not specified. +</p> + +<p> +The HTML form of the above <i>link block</i> will look like: +</p> + +<div class="code"><br /><a href="http://en.wikipedia.org/wiki/Special:Random"> Wikipedia Random Article </a><br /></div> + +<h2> images </h2> + +<p> +The markup for the <i>image block</i> looks like this: +</p> + +<div class="code"><br />{{/path/to/the/image.jpg|description of the image}}<br /></div> + +<p> +As seen above, the <i>image block</i> is enclosed with <span class="monospace">{{</span> & <span class="monospace">}}</span>. The +first part of the <i>image block</i> is the path to the location where +the image stored. The second part (which is optional) is a textual +description of the image. The textual description is what that is +shown when the image cannot be displayed in the browser(text-only +browsers, for instance). +</p> + +<p> +The two parts of the <i>image block</i> is separated by the <span class="monospace">|</span> (pipe) +symbol. The pipe symbol is eliminated, if the textual description of +the image is not specified. +</p> + +<h2> audio </h2> + +<p> +scruf uses HTML5 <audio> tag to embed audio. +</p> + +<p> +The markup for embedding audio: +</p> + +<div class="code"><br />{{audio:/path/to/the/audio.ogg}}<br /></div> + +<p> +As seen above, the <i>audio block</i> is enclosed with <span class="monospace">{{</span> & +<span class="monospace">}}</span>. Inside the braces, the <i>audio block</i> starts with <span class="monospace">audio:</span> +followed by the path to the audio file. +</p> + +<p> +At present, there is support for only Ogg Vorbis audio. +</p> + +<h2> footer </h2> + +<p> +The author's name and copyright information may be placed inside the +<i>footer block</i>. This block, as the name implies, is put at the end +of the document. +</p> + +<div class="code"><br />----------------------------------------------------------------------<br />written by Audacius Scrooge. It is licensed under CC-BY-SA<br />----------------------------------------------------------------------<br /></div> + +<p> +The <i>footer block</i> is enclosed by a pair of seventy hyphens +(<span class="monospace">-</span>). +</p> + +<p> +In Emacs, the whopping seventy hyphens can be generated with a <span class="monospace">C-u 70 +-</span>. +</p> + +<h2> have problems? </h2> + +<p> +If there are/is any issue(s) with understanding the <i>scruffy</i> +markup. Please subscribe & send an email to the +<a href="http://lists.nongnu.org/mailman/listinfo/scruf-friends">scruf-friends</a> +mailing list. That way we can solve your problem together. +</p> + +<p> +go back to the <a href="./scruf-howto.html">scruf-howto</a>. +</p> + + +<footer>a <i>scruffy</i> markup.</footer> + + + <div class="source"> + + <a href="./scruffy-markup.scruffy">source</a> + </div> +<div class="back"> +<a href="./"> back </a> +</div> +</article> + +<div class="lastupdate"> + Last Updated on: 21 December, 2012</div> + +<div class="scruf"> +<a href="http://nongnu.org/scruf/">powered by scruf</a> +</div> + +</body> +</html> |