Most recent update (All By Hand(TM)): 05-Jun-2012 23:32
Liberate, my madness
Liberate, my madness
I just want to
Liberate, my madness
Liberate, my madness
‒ Slipknot, Liberate
markdownID: Markdown import for InDesigna Jongware script
If you want to write simple documents using a plain text editor but still want to add basic text formatting, you can use Markdown: John Gruber's formatting system, with which you use short and easy-to-remember codes to mark up your text. Lots of websites and blogs are already using Markdown, so you can enter plain text and still have it formatted the way you want. With my Javascript The script supports lots of the standard functions from the original Markdown, and so you can use the Markdown reference for the basic set of commands. Unfortunately, there are also some functions that InDesign cannot easily emulate. Markdown was designed to work with HTML, and HTML allows unlimited nesting of its equivalent of 'paragraph' and 'character' styles – you can use a header inside a block quote and italics inside a hyperlink. However, since these codes are converted into InDesign Paragraph and Character Styles, you cannot nest them as InDesign can't do something similar. Markdown also lets you insert images; my script does not support this. With the real Markdown you can type "inline HTML" – any HTML command is copied verbatim into its output, as it was designed to work with HTML only. Writing a full HTML-to-InDesign parser goes a bit beyond the intention of this script, so I left that out in its entirety. Basic functionsThe following basic Markdown syntax functions are supported:
See the Markdown Syntax web page for more information on how to use the basic syntax. AdditionsStandard Markdown allows both single and double
If it does not come out the way you intended, you'll have to change the markup in an easier to parse way.
Triple markings such as You can safely use the underscore inside words for "special_terms" – its meaning is ignored when there are 'word' characters to its left and right. The original Markdown only uses the TablesBy way of addition to the standard Markdown syntax, it also supports simple tables. The following will automatically be converted to a basic table:
... this will come in as a proper table:
There must be a Spaces can be used to visually align the columns,
or you can let everything run together (but do use spaces, so you can better see what you are doing!).
If there is only one, or no space at the right hand side of a 'cell' and at
least two at the left hand side, the contents will be right-aligned. If there are two or more spaces at
both start and end of a cell, its contents will be centered. To insert a blank cell, make sure there is at least
one space between two
Special charactersThe script has extended support for special characters. Two dashes
Acute, grave, circumflex, tilde, and umlaut work on lowercase and uppercase Style translationThe necessary styles will be created automatically and get added to your current styles in a separate folder 'Markdown', but you
can provide a translation list from the default styles to your own. To do so, draw a small text frame somewhere on
the pasteboard next to any page in your document. Enter Character styles
Paragraph styles
Table Style
Cell Styles
Fortunately, you don't have to re-define all of them; and 'translated' style names do not need to exist in advance in your document, they will be added as soon as you run the script. How to useYou can use the script in two different ways. Running it with no text selected pops up an "Open File" dialog, so you can retrieve a file from your hard disk and 'place' it as usual. You can also select some text that you already typed or imported, and then run it; it will convert only the selected text, leaving the rest unchanged. Sample fileYou can view this document in its original MarkdownID notation here. You can open it in a text editor or import as 'plain text' into InDesign and check how I used the various commands, and then you can import it using the script and see how it comes in. CopyrightThe syntax used in
This version is entirely Jongware's interpretation of Markdown; as such its behavior and output may be different from the original version, intentional or by accident. In that case you probably can blaim Jongware for that. | ||||||||||
|
|
InDesign is a trademark of Adobe Systems Incorporated. Markdown is © 2004, John Gruber. |