pax_global_header00006660000000000000000000000064145365323030014516gustar00rootroot0000000000000052 comment=47dbc0a2da694368463edb6fa3cbca6b444ee872 marked-man-1.3.5/000077500000000000000000000000001453653230300135405ustar00rootroot00000000000000marked-man-1.3.5/.gitignore000066400000000000000000000000331453653230300155240ustar00rootroot00000000000000node_modules test/*/*.err marked-man-1.3.5/CHANGES.md000066400000000000000000000020631453653230300151330ustar00rootroot00000000000000# CHANGES ## 0.1.4 * depends on marked 0.3.2 * use .nf/.fi instead of .EX/.EE to format blockquotes ## 0.1.6 * ensure tests pass ## 0.2.0 * add support for gfm table ## 0.2.1 * remove useless test files from npm package ## 0.3.0 * accept a timestamp in milliseconds as --date argument ## 1.0.0 * node >= 12 * --format option is dropped, use directly marked for html output * other options should work the same * mostly rewritten * depends marked >= 4.2 * more groff macros are implemented ## 1.1.0 * --breaks is now the default ## 1.2.0 * the level-2 NAME section is not generated if it already exists * --section, if missing from ronn header, is set to 1 by default * --manual, if missing, is now omitted to let man display a default value * --description can set the description if not set from ronn header format * --version, if missing, is read from package.json of target file module, or omitted. ## 1.3.0 * fix crash when md has only one token * better support for stdin, e.g. `cat file.md | marked-man | man /dev/stdin` * fix blockquote, use a table marked-man-1.3.5/LICENSE000066400000000000000000000026001453653230300145430ustar00rootroot00000000000000Files:* Copyright: 2013-2022 Jérémy Lal License: MIT Files: lib/marked-man.js Copyright: 2013 Jérémy Lal 2011-2013 Christopher Jeffrey (https://github.com/chjj/) License: MIT Files: test/files/* Copyright: 2013 Jérémy Lal 2009 Ryan Tomayko (http://tomayko.com/about) License: MIT License: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. marked-man-1.3.5/Makefile000066400000000000000000000001551453653230300152010ustar00rootroot00000000000000man/marked-man.1: README.md ./bin/marked-man -o $@ $< doc: man/marked-man.1 check: node test/compare.js marked-man-1.3.5/README.md000066400000000000000000000044671453653230300150320ustar00rootroot00000000000000marked-man(1) -- markdown to roff ================================= SYNOPSIS -------- ```bash marked-man README.md > doc/foo.1 # works too with stdin cat README.md | marked-man --version 1.0 | man /dev/stdin ``` See also [marked documentation](https://marked.js.org/). DESCRIPTION ----------- `marked-man` wraps `marked` to extend it with groff output support in order to create Unix manual pages for use with `man`. It follows the `ronn` markdown level-1 header format: # name(section) -- short description which populates the *HEADER* section, and the *NAME* section (if none is already written) of the manpage. OPTIONS ------- `marked-man` is a `marked` CLI extension, meaning options can be passed directly to marked. The `--breaks` option, which retains intra-paragraph line breaks, is now true by default. Use `--no-breaks` to disable it. `marked-man` adds some options to `marked`'s existing options, to be able to override the header/footer of generated man pages. * `--name ` Optional, overrides `name` in ronn header. * `--section
` Optional, overrides `section` in ronn header. Defaults to 1. * `--description ` Optional, overrides `description` in ronn header. * `--version ` The version shown in the manpage footer. Optional, when omitted, defaults to the target node module version, or empty. * `--manual ` The manual-group name shown in the manpage header. Optional, when omitted, man displays a value matching the section. * `--date ` The date shown in the manpage header. Optional, defaults to now. Must be acceptable to `new Date(string or timestamp)`. Honors `SOURCE_DATE_EPOCH` environment variable for reproducible builds. INSTALLATION ------------ See your node package manager manual... For example: ```bash npx marked-man simple.md ``` EXAMPLE ------- To view this README as a man page, run something like the following: ```bash marked-man README.md | man /dev/stdin ``` AS MARKED EXTENSION ------------------- ```js import markedMan from 'marked-man'; import marked from 'marked'; marked.use(markedMan); ``` SEE ALSO -------- [Ronn](https://github.com/rtomayko/ronn) [Ronn-NG](https://github.com/apjanke/ronn-ng) [groff](https://man.cx/groff_man(7)) REPORTING BUGS -------------- See [marked-man repository](https://github.com/kapouer/marked-man). marked-man-1.3.5/bin/000077500000000000000000000000001453653230300143105ustar00rootroot00000000000000marked-man-1.3.5/bin/marked-man.js000077500000000000000000000006601453653230300166670ustar00rootroot00000000000000#!/usr/bin/env node import markedMan from 'marked-man'; import { marked } from 'marked'; const { argv } = process; argv.forEach((arg, i) => { if (arg.startsWith("--version")) { argv[i] = arg.replace(/^--version/, "--man-version"); } }); let fileArg = argv.slice(-1)[0]; if (fileArg == argv[1] || fileArg.startsWith('-')) { fileArg = null; } markedMan.fileArg = fileArg; marked.use(markedMan); import('marked/bin/marked'); marked-man-1.3.5/man/000077500000000000000000000000001453653230300143135ustar00rootroot00000000000000marked-man-1.3.5/man/marked-man.1000066400000000000000000000030211453653230300164050ustar00rootroot00000000000000.TH "MARKED\-MAN" "1" "January 2014" "" "" .SH "NAME" \fBmarked-man\fR \- markdown to roff .SH SYNOPSIS .P .RS 2 .EX marked\-man README\.md > doc/marked\-man\.1 .EE .RE .P See marked README \fIhttps://github\.com/chjj/marked\fR for documentation about how to use marked\. .P Note that \fBmarked\-man \-\-format=html\fR is the same as \fBmarked\fR\|\. .SH DESCRIPTION .P \fBmarked\-man\fR wraps \fBmarked\fR to extend it with groff output support\. .SH OPTIONS .P \fBmarked\-man\fR adds some options to \fBmarked\fR existing options: .RS 0 .IP \(bu 2 format Sets the output format\. Outputs html if different from \fBroff\fR\|\. Defaults to \fBroff\fR\|\. .IP \(bu 2 name The name shown in the manpage header, if it isn\'t given in the ronn header like in this README\. Defaults to empty string\. .IP \(bu 2 section The section shown in the manpage header, if it isn\'t given in the ronn header like in this README\. Defaults to empty string\. .IP \(bu 2 version The version shown in the manpage header\. Defaults to empty string\. .IP \(bu 2 manual The MANUAL string shown in the manpage header\. Defaults to empty string\. .IP \(bu 2 date The date shown in the manpage header\. Defaults to now, must be acceptable by new Date(string)\. .RE .P \fBmarked\-man\fR invokes \fBmarked \-\-gfm \-\-sanitize\fR\|\. The \-\-breaks option can be helpful to match default \fBronn\fR behavior\. .SH SEE ALSO .P Ryan Tomayko \fIhttps://github\.com/rtomayko/ronn\fR .SH REPORTING BUGS .P See marked\-man repository \fIhttps://github\.com/kapouer/marked\-man\fR\|\. marked-man-1.3.5/package.json000066400000000000000000000020711453653230300160260ustar00rootroot00000000000000{ "name": "marked-man", "version": "1.3.5", "description": "wrapper adding manpage output to 'marked', inspired by 'ronn'", "type": "module", "main": "./src/index.js", "exports": { ".": "./src/index.js", "./package.json": "./package.json" }, "bin": { "marked-man": "./bin/marked-man.js" }, "files": [ "bin/", "src/" ], "man": [ "./man/marked-man.1" ], "scripts": { "test": "node ./test/compare" }, "repository": { "type": "git", "url": "git://github.com/kapouer/marked-man.git" }, "keywords": [ "markdown", "roff", "ronn" ], "author": "Jérémy Lal ", "license": "MIT", "dependencies": { "marked": "^4.2.12", "read-pkg-up": "^9.1.0" }, "devDependencies": { "@kapouer/eslint-config": "^1.9.0" }, "eslintConfig": { "extends": "@kapouer/eslint-config", "overrides": [ { "files": [ "src/**.js", "test/**.js" ], "env": { "es6": true, "node": true } } ] } } marked-man-1.3.5/src/000077500000000000000000000000001453653230300143275ustar00rootroot00000000000000marked-man-1.3.5/src/extensions.js000066400000000000000000000021631453653230300170660ustar00rootroot00000000000000const empty = { name: 'empty', level: 'inline', renderer() { return ""; } }; const link = { name: 'link', level: 'inline', tokenizer(src, tokens) { if (!tokens.length || /^\p{Po}/u.test(src) == false) return; const tok = tokens[tokens.length - 1]; if (tok.type == "link") { tok.punctuation = src.charAt(0); return { type: "empty", raw: tok.punctuation }; } }, renderer({ href, title, text, punctuation }) { if (href.startsWith('#')) { // a local reference, not a link return `\\fI${title || text || href.slice(1)}\\fR`; } const obj = new URL(href, "file://./"); const ret = []; if (!this.parser.renderer.jumps) ret.push(""); const content = title || text || ''; if (content == href || obj.protocol + content == href) return text; if (obj.protocol == "mailto:") { ret.push(".MT " + href, content ? '.I ' + content : '', ".ME"); } else { ret.push(".UR " + href, content ? '.I ' + content : '', ".UE"); } if (punctuation) ret[ret.length - 1] += " " + punctuation; ret.push(""); this.parser.renderer.jumps = true; return ret.join('\n'); } }; export default [empty, link]; marked-man-1.3.5/src/index.js000066400000000000000000000025711453653230300160010ustar00rootroot00000000000000import { Parser } from 'marked'; import { readPackageUpSync } from 'read-pkg-up'; import Path from 'path'; import * as renderer from './renderer.js'; import * as tokenizer from './tokenizer.js'; import extensions from './extensions.js'; // https://github.com/markedjs/marked/issues/2639 const defaultParse = Parser.parse; Parser.parse = (tokens, options) => { const [{ type, depth }, sec] = tokens; if (type != "heading" || depth != 1) { tokens.unshift({ type: 'heading', depth: 1, tokens: [] }); } options.disableLevel2Name = sec && sec.type == "heading" && sec.depth == 2 && sec.text && sec.text.toUpperCase() == "NAME"; return defaultParse.call(Parser, tokens, options); }; export default { // marked-man defaults date: (() => { if (typeof process == "undefined" || !process.env.SOURCE_DATE_EPOCH) { return Date.now(); } else { return parseInt(process.env.SOURCE_DATE_EPOCH) * 1000; } })(), mangle: false, breaks: true, name: null, section: null, manual: null, set manVersion(val) { this.userDefinedVersion = val; }, get manVersion() { if (this.userDefinedVersion) { return this.userDefinedVersion; } else if (this.fileArg) { const pkg = readPackageUpSync(Path.dirname(this.fileArg)); return pkg ? pkg.packageJson.version : null; } else { return null; } }, // output to roff renderer, tokenizer, // custom fixes extensions }; marked-man-1.3.5/src/renderer.js000066400000000000000000000054411453653230300164770ustar00rootroot00000000000000import { htmlEsc, manEsc, parseHeader } from './utils.js'; export function code(code, infostring, escaped) { this.jumps = true; return [ '.RS 2', '.nf', manEsc(code), '.fi', '.RE', '' ].join('\n'); } export function blockquote(quote) { this.jumps = true; return [ '.TS', 'tab(|) nowarn;', 'cx.', 'T{', quote, 'T}', '.TE', '' ].join('\n'); } export function html(html) { return htmlEsc(html); } export function heading(text, level, raw, slugger) { this.jumps = true; let macro; if (level == 1) { macro = 'TH'; text = parseHeader(raw || "", this.options); } else if (level == 2) { macro = 'SH'; } else { macro = 'SS'; } return '.' + macro + ' ' + text + '\n'; } export function hr() { this.jumps = true; return '.HR\n'; } export function list(body) { return [ '\n.RS 1', body, '.RE', '' ].join('\n'); } export function listitem(text) { // first ^.P return [ `.IP \\(bu 2`, text.trim().replace(/^\.P\s/, '').replace(/\.P /, '.br\n'), '' ].join('\n'); } export function checkbox(checked) { } export function paragraph(text) { this.jumps = true; const ret = [ '.P', text.trim() ]; if (text) ret.push(''); return ret.join('\n'); } export function table(header, body) { this.jumps = false; const { tableCols } = this; delete this.tableCols; return [ '.TS', 'tab(|) expand nowarn box;', tableCols.join(' ') + '.', dropLastRowSep(header.trim()), '=', dropLastRowSep(body.trim()), '.TE', '' ].join('\n'); } export function tablerow(content) { if (this.tableCols) this.tableCols.done = true; return dropLastCellSep(content) + '\n_\n'; } export function tablecell(content, flags) { if (!this.tableCols) this.tableCols = []; if (!this.tableCols.done) { this.tableCols.push(getCellAlign(flags.align)); } return ['T{', content, 'T}|'].join('\n'); } function dropLastRowSep(str) { return str.replace(/\n_$/, ''); } function dropLastCellSep(str) { return str.replace(/\|$/, ''); } function getCellAlign(align) { switch (align) { case "right": return "r"; case "center": return "c"; default: return "l"; } } export function strong(text) { this.jumps = false; return '\\fB' + text + '\\fR'; } export function em(text) { this.jumps = false; return '\\fI' + text + '\\fR'; } export function codespan(code) { this.jumps = false; return '\\fB' + htmlEsc(code, true) + '\\fP'; } export function br() { this.jumps = true; return '\n.br\n'; } export function del(text) { return "-" + text + "-"; } export function image(href, title, text) { if (href == text) { return '\\fI' + href + '\\fR'; } else { return '\\fI' + text + '\\fR[' + href + ']'; } } export function text(text) { if (this.jumps) { text = text.trimStart(); this.jumps = false; } return htmlEsc(text); } marked-man-1.3.5/src/tokenizer.js000066400000000000000000000002431453653230300166760ustar00rootroot00000000000000export function inlineText(src) { const cap = this.rules.inline.text.exec(src); if (cap) { return { type: 'text', raw: cap[0], text: cap[0] }; } } marked-man-1.3.5/src/utils.js000066400000000000000000000037511453653230300160330ustar00rootroot00000000000000export function quote(str) { return '"' + str + '"'; } export function manEsc(str) { return str .replace(/\\/gm, "\\\\") .replace(/-/gm, "\\-") .replace(/^\s*\./gm, "\\|.") .replace(/\./gm, "\\.") .replace(/^'/gm, "\\|'"); } export function htmlEsc(str) { return rentities(manEsc(str)) .replace(/>/gm, '>') .replace(/</gm, '<') .replace(/&/gm, '&'); } export function rentities(str) { return str.replace(/&(\w+);/gm, (match, ent) => { const gr = { bull: '[ci]', nbsp: '~', copy: '(co', rdquo: '(rs', mdash: '(em', reg: '(rg', sect: '(sc', ge: '(>=', le: '(<=', ne: '(!=', equiv: '(==', plusmn: '(+-' }[ent]; if (gr) return '\\' + gr; else return match; }); } export function parseHeader(str, options) { const { groups: { name = options.name || "", section = options.section || "", last = "" } } = /^(?[\w_.[\]~+=@:-]+)\s*(?:\((?
\d\w*)\))?(?:\s*-+\s*(?.*))?$/.exec(str) || { groups: {} }; let text = last; if (!text) { if (name || section) text = ""; else text = str; } if (name && text) text = " - " + text; let out = quote(manEsc(name.toUpperCase())) + " " + quote(section || "1") + " " + quote(manDate(options.date)) + (options.manVersion ? " " + quote(options.manVersion) : "") + (options.manual ? " " + quote(options.manual) : ""); // use default value if (!options.disableLevel2Name) { out = out + "\n.SH " + quote("NAME") + "\n\\fB" + name + "\\fR" + manEsc(text); } else { delete options.disableLevel2Name; } return out; } export function manDate(str) { let date; if (typeof str == "string") { const stamp = parseInt(str); if (!Number.isNaN(stamp) && stamp.toString().length == str.length) { date = new Date(stamp); } } if (!date) { date = new Date(str); } if (Number.isNaN(date.getTime())) { throw new Error("Bad date option: " + str); } return date.toLocaleString('en', { month: 'long', year: 'numeric', timeZone: 'UTC' }); } marked-man-1.3.5/test/000077500000000000000000000000001453653230300145175ustar00rootroot00000000000000marked-man-1.3.5/test/compare.js000066400000000000000000000054321453653230300165070ustar00rootroot00000000000000import { promises as fs } from 'fs'; import * as Path from 'path'; import { promisify } from 'util'; import { exec } from 'child_process'; import { fileURLToPath } from 'url'; const __filename = fileURLToPath(import.meta.url); const __dirname = Path.dirname(__filename); const execa = promisify(exec); import markedMan from 'marked-man'; import { marked } from 'marked'; marked.use(markedMan); // params const ronnDir = Path.join(__dirname, "md"); const manDir = Path.join(__dirname, "man"); const outDir = Path.join(__dirname, "out"); main(); async function convert(name, str) { const roff = marked.parse(str, { name, date: '1979-01-01', breaks: true }); const [status, manPath] = await writeOrCompare(roff, manDir, name + ".1"); const { stdout, stderr } = await execa(`man --warnings --encoding=UTF-8 ${manPath}`, { env: { LC_ALL: "C.UTF-8", MAN_KEEP_FORMATTING: '1', MANWIDTH: "80" } }); if (stderr) console.error(manPath, '\n', stderr); return [status, stdout]; } async function main() { const files = await fs.readdir(ronnDir); let fails = 0, works = 0, news = 0; try { await fs.rm(manDir + "-err", { recursive: true }); await fs.rm(outDir + "-err", { recursive: true }); } catch (err) { // pass } await fs.mkdir(manDir + "-err", { recursive: true }); await fs.mkdir(outDir + "-err", { recursive: true }); await Promise.all(files.map(async file => { const status = await check(file); switch (status) { case -1: fails++; break; case 0: works++; break; case 1: news++; break; } })); if (fails > 0) console.error("Failed tests: ", fails); if (works > 0) console.info("Succeeded tests: ", works); if (news > 0) console.info("New tests: ", news); if (fails == 0) { console.info("All tests passed"); await fs.rm(manDir + "-err", { recursive: true }); await fs.rm(outDir + "-err", { recursive: true }); } else { process.exit(1); } } async function writeOrCompare(str, root, name) { const okpath = Path.join(root, name); const errpath = Path.join(root + "-err", name); let status = 0; try { const expect = (await fs.readFile(okpath)).toString(); if (expect != str) { console.error("Test failure, result written in", errpath); await fs.writeFile(errpath, str); status = -1; } } catch (e) { console.info("Missing test, result written in", okpath); await fs.writeFile(okpath, str); status = 1; } return [status, status >= 0 ? okpath : errpath]; } async function check(filename) { const ronnBuf = await fs.readFile(Path.join(ronnDir, filename)); const name = Path.basename(filename, Path.extname(filename)); const [statusMan, output] = await convert(name, ronnBuf.toString()); if (statusMan != 0) return statusMan; const [statusOut] = await writeOrCompare(output, outDir, name + ".out"); return statusOut; } marked-man-1.3.5/test/man/000077500000000000000000000000001453653230300152725ustar00rootroot00000000000000marked-man-1.3.5/test/man/blockquotes.1000066400000000000000000000004701453653230300177100ustar00rootroot00000000000000.TH "T" "1" "January 1979" .SH "NAME" \fBt\fR \- test .SH test .RS 2 .nf A blockquote here\. Continuing on second line\. .fi .RE .P Hello\. .TS tab(|) nowarn; cx. T{ .P Another block quote\. With a long title\. That will break a line eventually later\. .br that continues on second line .br continuation T} .TE marked-man-1.3.5/test/man/definition_list_syntax.1000066400000000000000000000005431453653230300221470ustar00rootroot00000000000000.TH "DEFITION_LIST_SYNTAX" "5" "January 1979" .SH "NAME" \fBdefition_list_syntax\fR \- hiya .P Definition lists look like unordered lists: .RS 1 .IP \(bu 2 term: .br definition .IP \(bu 2 another one: .br The definition may span .br multiple lines and even .br start .br new paragraphs .IP \(bu 2 \fB\-\-somearg\fP=: .br We can do that too\. .RE marked-man-1.3.5/test/man/dots_at_line_start_test.1000066400000000000000000000003521453653230300222740ustar00rootroot00000000000000.TH "DOTS_AT_LINE_START_TEST" "1" "January 1979" .SH "NAME" \fBdots_at_line_start_test\fR .P There's a weird issue where dots at the beginning of a line .br generate troff warnings due to escaping\. .P \|\.\. let's see what happens\. marked-man-1.3.5/test/man/ellipses.1000066400000000000000000000003221453653230300171710ustar00rootroot00000000000000.TH "ELLIPSES" "7" "January 1979" .SH "NAME" \fBellipses\fR \- testing ellipses .P Ellipses should be replaced\.\.\. .P \|\.\.\.also, they shouldn't interfere with regular dots at the beginning .br of a line\. marked-man-1.3.5/test/man/entity_encoding_test.1000066400000000000000000000012511453653230300215740ustar00rootroot00000000000000.TH "HELLO" "1" "January 1979" .SH "NAME" \fBhello\fR \- hello world .P Your output might look like this: .RS 2 .nf * Chris * * <b>GitHub</b> * GitHub .fi .RE .P Here's some special entities: .RS 1 .IP \(bu 2 • \[ci] .IP \(bu 2   \~ .IP \(bu 2 © \(co .IP \(bu 2 ” \(rs .IP \(bu 2 — \(em .IP \(bu 2 ® \(rg .IP \(bu 2 § \(sc .IP \(bu 2 ≥ \(>= .IP \(bu 2 ≤ \(<= .IP \(bu 2 ≠ \(!= .IP \(bu 2 ≡ \(== .IP \(bu 2 ± \(+- .RE .P Here's a line that uses non\-breaking spaces to force the .br last\~few\~words\~to\~wrap\~together\. marked-man-1.3.5/test/man/escapes.1000066400000000000000000000006551453653230300170050ustar00rootroot00000000000000.TH "ESCAPES" "1" "January 1979" .SH "NAME" \fBescapes\fR .P backslashes before the asterisks, like this: .RS 2 .nf \\*literal asterisks\\* .fi .RE .P Markdown provides backslash escapes for the following characters: .RS 2 .nf \\ backslash ` backtick * asterisk _ underscore {} curly braces [] square brackets () parentheses # hash mark + plus sign \- minus sign (hyphen) \|\. dot ! exclamation mark .fi .RE marked-man-1.3.5/test/man/graves.1000066400000000000000000000001721453653230300166430ustar00rootroot00000000000000.TH "TEST" "1" "January 1979" .SH "NAME" \fBtest\fR .SH this title \fBwill render\fP strangely .P This is the body text\. marked-man-1.3.5/test/man/links.1000066400000000000000000000012631453653230300164760ustar00rootroot00000000000000.TH "LINKS" "1" "January 1979" .SH "NAME" \fBlinks\fR .P I get 10 times more traffic from .UR http://google.com/ .I Google .UE than from .br .UR http://search.yahoo.com/ .I Yahoo Search .UE or .UR http://search.msn.com/ .I MSN Search .UE . .P This is to test proper escape of html chars and non\-repeating link: .br xxxxx@xxxx.xxxx.xxxx.xx .P I get 10 times more traffic from .UR http://google.com/ .I Google .UE than from .br .UR http://search.yahoo.com/ .I Yahoo Search .UE or .UR http://search.msn.com/ .I MSN Search .UE . .P Non\-repeating http link https://example.com/test .P Also .br .UR http://google.com/ .I Google .UE .P and .UR ./table.md .I local links should not crash .UE marked-man-1.3.5/test/man/list.1000066400000000000000000000007071453653230300163330ustar00rootroot00000000000000.TH "A" "1" "January 1979" .SH "NAME" \fBa\fR .P This is a tight list: .RS 1 .IP \(bu 2 \fBtoggle_status\fP: test .IP \(bu 2 \fBspawn \fP .br TODO explain path\-alike expansion, .br ability to get a block here\. .RE .P This is a loose list: .RS 1 .IP \(bu 2 \fBtoggle_status\fP: .br test .IP \(bu 2 \fBspawn \fP: .br TODO explain path\-alike expansion, .br ability to get a block here\. .RE marked-man-1.3.5/test/man/markdown_syntax.1000066400000000000000000000720061453653230300206110ustar00rootroot00000000000000.TH "MARKDOWN" "5" "January 1979" .SH "NAME" \fBmarkdown\fR \- humane markup syntax .SH SYNOPSIS .RS 2 .nf # Header 1 # ## Header 2 ## ### Header 3 ### (Hashes on right are optional) #### Header 4 #### ##### Header 5 ##### This is a paragraph, which is text surrounded by whitespace\. Paragraphs can be on one line (or many), and can drone on for hours\. [Reference style links][1] and [inline links](http://example\.com) [1]: http://example\.com "Title is optional" Inline markup like _italics_, **bold**, and `code()`\. ![picture alt](/images/photo\.jpeg "Title is optional") > Blockquotes are like quoted text in email replies >> And, they can be nested code blocks are for preformatted text and must be indented with four spaces * Bullet lists are easy too * You can * even * nest them \- Another one + Another one .fi .RE .SH DESCRIPTION .SS Philosophy .P Markdown is intended to be as easy\-to\-read and easy\-to\-write as is feasible\. .P Readability, however, is emphasized above all else\. A Markdown\-formatted .br document should be publishable as\-is, as plain text, without looking .br like it's been marked up with tags or formatting instructions\. While .br Markdown's syntax has been influenced by several existing text\-to\-HTML .br filters \-\- including .UR http://docutils.sourceforge.net/mirror/setext.html .I Setext .UE , .UR http://www.aaronsw.com/2002/atx/ .I atx .UE , .UR http://textism.com/tools/textile/ .I Textile .UE , .UR http://docutils.sourceforge.net/rst.html .I reStructuredText .UE , .br .UR http://www.triptico.com/software/grutatxt.html .I Grutatext .UE , and .UR http://ettext.taint.org/doc/ .I EtText .UE \-\- the single biggest source of .br inspiration for Markdown's syntax is the format of plain text email\. .P To this end, Markdown's syntax is comprised entirely of punctuation .br characters, which punctuation characters have been carefully chosen so .br as to look like what they mean\. E\.g\., asterisks around a word actually .br look like *emphasis*\|\. Markdown lists look like, well, lists\. Even .br blockquotes look like quoted passages of text, assuming you've ever .br used email\. .SS Inline HTML .P Markdown's syntax is intended for one purpose: to be used as a .br format for \fIwriting\fR for the web\. .P Markdown is not a replacement for HTML, or even close to it\. Its .br syntax is very small, corresponding only to a very small subset of .br HTML tags\. The idea is \fInot\fR to create a syntax that makes it easier .br to insert HTML tags\. In my opinion, HTML tags are already easy to .br insert\. The idea for Markdown is to make it easy to read, write, and .br edit prose\. HTML is a \fIpublishing\fR format; Markdown is a \fIwriting\fR .br format\. Thus, Markdown's formatting syntax only addresses issues that .br can be conveyed in plain text\. .P For any markup that is not covered by Markdown's syntax, you simply .br use HTML itself\. There's no need to preface it or delimit it to .br indicate that you're switching from Markdown to HTML; you just use .br the tags\. .P The only restrictions are that block\-level HTML elements \-\- e\.g\. \fB
\fP, .br \fB\fP, \fB
\fP, \fB

\fP, etc\. \-\- must be separated from surrounding .br content by blank lines, and the start and end tags of the block should .br not be indented with tabs or spaces\. Markdown is smart enough not .br to add extra (unwanted) \fB

\fP tags around HTML block\-level tags\. .P For example, to add an HTML table to a Markdown article: .RS 2 .nf This is a regular paragraph\.

Foo
This is another regular paragraph\. .fi .RE .P Note that Markdown formatting syntax is not processed within block\-level .br HTML tags\. E\.g\., you can't use Markdown\-style \fB*emphasis*\fP inside an .br HTML block\. .P Span\-level HTML tags \-\- e\.g\. \fB\fP, \fB\fP, or \fB\fP \-\- can be .br used anywhere in a Markdown paragraph, list item, or header\. If you .br want, you can even use HTML tags instead of Markdown formatting; e\.g\. if .br you'd prefer to use HTML \fB\fP or \fB\fP tags instead of Markdown's .br link or image syntax, go right ahead\. .P Unlike block\-level HTML tags, Markdown syntax \fIis\fR processed within .br span\-level tags\. .SS Automatic Escaping for Special Characters .P In HTML, there are two characters that demand special treatment: \fB<\fP .br and \fB&\fP\|\. Left angle brackets are used to start tags; ampersands are .br used to denote HTML entities\. If you want to use them as literal .br characters, you must escape them as entities, e\.g\. \fB<\fP, and .br \fB&\fP\|\. .P Ampersands in particular are bedeviling for web writers\. If you want to .br write about 'AT&T', you need to write '\fBAT&T\fP\|'\. You even need to .br escape ampersands within URLs\. Thus, if you want to link to: .RS 2 .nf http://images\.google\.com/images?num=30&q=larry+bird .fi .RE .P you need to encode the URL as: .RS 2 .nf http://images\.google\.com/images?num=30&q=larry+bird .fi .RE .P in your anchor tag \fBhref\fP attribute\. Needless to say, this is easy to .br forget, and is probably the single most common source of HTML validation .br errors in otherwise well\-marked\-up web sites\. .P Markdown allows you to use these characters naturally, taking care of .br all the necessary escaping for you\. If you use an ampersand as part of .br an HTML entity, it remains unchanged; otherwise it will be translated .br into \fB&\fP\|\. .P So, if you want to include a copyright symbol in your article, you can write: .RS 2 .nf © .fi .RE .P and Markdown will leave it alone\. But if you write: .RS 2 .nf AT&T .fi .RE .P Markdown will translate it to: .RS 2 .nf AT&T .fi .RE .P Similarly, because Markdown supports \fIinline HTML\fR if you use .br angle brackets as delimiters for HTML tags, Markdown will treat them as .br such\. But if you write: .RS 2 .nf 4 < 5 .fi .RE .P Markdown will translate it to: .RS 2 .nf 4 < 5 .fi .RE .P However, inside Markdown code spans and blocks, angle brackets and .br ampersands are \fIalways\fR encoded automatically\. This makes it easy to use .br Markdown to write about HTML code\. (As opposed to raw HTML, which is a .br terrible format for writing about HTML syntax, because every single \fB<\fP .br and \fB&\fP in your example code needs to be escaped\.) .SH BLOCK ELEMENTS .SS Paragraphs and Line Breaks .P A paragraph is simply one or more consecutive lines of text, separated .br by one or more blank lines\. (A blank line is any line that looks like a .br blank line \-\- a line containing nothing but spaces or tabs is considered .br blank\.) Normal paragraphs should not be indented with spaces or tabs\. .P The implication of the "one or more consecutive lines of text" rule is .br that Markdown supports "hard\-wrapped" text paragraphs\. This differs .br significantly from most other text\-to\-HTML formatters (including Movable .br Type's "Convert Line Breaks" option) which translate every line break .br character in a paragraph into a \fB
\fP tag\. .P When you \fIdo\fR want to insert a \fB
\fP break tag using Markdown, you .br end a line with two or more spaces, then type return\. .P Yes, this takes a tad more effort to create a \fB
\fP, but a simplistic .br "every line break is a \fB
\fP" rule wouldn't work for Markdown\. .br Markdown's email\-style \fIblockquoting\fR and multi\-paragraph \fIlist items\fR .br work best \-\- and look better \-\- when you format them with hard breaks\. .SS Headers .P Markdown supports two styles of headers, [Setext] .UR http://docutils.sourceforge.net/mirror/setext.html .I 1 .UE and [atx] .UR http://www.aaronsw.com/2002/atx/ .I 2 .UE . .P Setext\-style headers are "underlined" using equal signs (for first\-level .br headers) and dashes (for second\-level headers)\. For example: .RS 2 .nf This is an H1 ============= This is an H2 \-\-\-\-\-\-\-\-\-\-\-\-\- .fi .RE .P Any number of underlining \fB=\fP\|'s or \fB\-\fP\|'s will work\. .P Atx\-style headers use 1\-6 hash characters at the start of the line, .br corresponding to header levels 1\-6\. For example: .RS 2 .nf # This is an H1 ## This is an H2 ###### This is an H6 .fi .RE .P Optionally, you may "close" atx\-style headers\. This is purely .br cosmetic \-\- you can use this if you think it looks better\. The .br closing hashes don't even need to match the number of hashes .br used to open the header\. (The number of opening hashes .br determines the header level\.) : .RS 2 .nf # This is an H1 # ## This is an H2 ## ### This is an H3 ###### .fi .RE .SS Blockquotes .P Markdown uses email\-style \fB>\fP characters for blockquoting\. If you're .br familiar with quoting passages of text in an email message, then you .br know how to create a blockquote in Markdown\. It looks best if you hard .br wrap the text and put a \fB>\fP before every line: .RS 2 .nf > This is a blockquote with two paragraphs\. Lorem ipsum dolor sit amet, > consectetuer adipiscing elit\. Aliquam hendrerit mi posuere lectus\. > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus\. > > Donec sit amet nisl\. Aliquam semper ipsum sit amet velit\. Suspendisse > id sem consectetuer libero luctus adipiscing\. .fi .RE .P Markdown allows you to be lazy and only put the \fB>\fP before the first .br line of a hard\-wrapped paragraph: .RS 2 .nf > This is a blockquote with two paragraphs\. Lorem ipsum dolor sit amet, consectetuer adipiscing elit\. Aliquam hendrerit mi posuere lectus\. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus\. > Donec sit amet nisl\. Aliquam semper ipsum sit amet velit\. Suspendisse id sem consectetuer libero luctus adipiscing\. .fi .RE .P Blockquotes can be nested (i\.e\. a blockquote\-in\-a\-blockquote) by .br adding additional levels of \fB>\fP: .RS 2 .nf > This is the first level of quoting\. > > > This is nested blockquote\. > > Back to the first level\. .fi .RE .P Blockquotes can contain other Markdown elements, including headers, lists, .br and code blocks: .RS 2 .nf > ## This is a header\. > > 1\. This is the first list item\. > 2\. This is the second list item\. > > Here's some example code: > > return shell_exec("echo $input | $markdown_script"); .fi .RE .P Any decent text editor should make email\-style quoting easy\. For .br example, with BBEdit, you can make a selection and choose Increase .br Quote Level from the Text menu\. .SS Lists .P Markdown supports ordered (numbered) and unordered (bulleted) lists\. .P Unordered lists use asterisks, pluses, and hyphens \-\- interchangably .br \-\- as list markers: .RS 2 .nf * Red * Green * Blue .fi .RE .P is equivalent to: .RS 2 .nf + Red + Green + Blue .fi .RE .P and: .RS 2 .nf \- Red \- Green \- Blue .fi .RE .P Ordered lists use numbers followed by periods: .RS 2 .nf 1\. Bird 2\. McHale 3\. Parish .fi .RE .P It's important to note that the actual numbers you use to mark the .br list have no effect on the HTML output Markdown produces\. The HTML .br Markdown produces from the above list is: .RS 2 .nf
  1. Bird
  2. McHale
  3. Parish
.fi .RE .P If you instead wrote the list in Markdown like this: .RS 2 .nf 1\. Bird 1\. McHale 1\. Parish .fi .RE .P or even: .RS 2 .nf 3\. Bird 1\. McHale 8\. Parish .fi .RE .P you'd get the exact same HTML output\. The point is, if you want to, .br you can use ordinal numbers in your ordered Markdown lists, so that .br the numbers in your source match the numbers in your published HTML\. .br But if you want to be lazy, you don't have to\. .P If you do use lazy list numbering, however, you should still start the .br list with the number 1\. At some point in the future, Markdown may support .br starting ordered lists at an arbitrary number\. .P List markers typically start at the left margin, but may be indented by .br up to three spaces\. List markers must be followed by one or more spaces .br or a tab\. .P To make lists look nice, you can wrap items with hanging indents: .RS 2 .nf * Lorem ipsum dolor sit amet, consectetuer adipiscing elit\. Aliquam hendrerit mi posuere lectus\. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus\. * Donec sit amet nisl\. Aliquam semper ipsum sit amet velit\. Suspendisse id sem consectetuer libero luctus adipiscing\. .fi .RE .P But if you want to be lazy, you don't have to: .RS 2 .nf * Lorem ipsum dolor sit amet, consectetuer adipiscing elit\. Aliquam hendrerit mi posuere lectus\. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus\. * Donec sit amet nisl\. Aliquam semper ipsum sit amet velit\. Suspendisse id sem consectetuer libero luctus adipiscing\. .fi .RE .P If list items are separated by blank lines, Markdown will wrap the .br items in \fB

\fP tags in the HTML output\. For example, this input: .RS 2 .nf * Bird * Magic .fi .RE .P will turn into: .RS 2 .nf

  • Bird
  • Magic
.fi .RE .P But this: .RS 2 .nf * Bird * Magic .fi .RE .P will turn into: .RS 2 .nf
  • Bird

  • Magic

.fi .RE .P List items may consist of multiple paragraphs\. Each subsequent .br paragraph in a list item must be indented by either 4 spaces .br or one tab: .RS 2 .nf 1\. This is a list item with two paragraphs\. Lorem ipsum dolor sit amet, consectetuer adipiscing elit\. Aliquam hendrerit mi posuere lectus\. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus\. Donec sit amet nisl\. Aliquam semper ipsum sit amet velit\. 2\. Suspendisse id sem consectetuer libero luctus adipiscing\. .fi .RE .P It looks nice if you indent every line of the subsequent .br paragraphs, but here again, Markdown will allow you to be .br lazy: .RS 2 .nf * This is a list item with two paragraphs\. This is the second paragraph in the list item\. You're only required to indent the first line\. Lorem ipsum dolor sit amet, consectetuer adipiscing elit\. * Another item in the same list\. .fi .RE .P To put a blockquote within a list item, the blockquote's \fB>\fP .br delimiters need to be indented: .RS 2 .nf * A list item with a blockquote: > This is a blockquote > inside a list item\. .fi .RE .P To put a code block within a list item, the code block needs .br to be indented \fItwice\fR \-\- 8 spaces or two tabs: .RS 2 .nf * A list item with a code block: .fi .RE .P It's worth noting that it's possible to trigger an ordered list by .br accident, by writing something like this: .RS 2 .nf 1986\. What a great season\. .fi .RE .P In other words, a \fInumber\-period\-space\fR sequence at the beginning of a .br line\. To avoid this, you can backslash\-escape the period: .RS 2 .nf 1986\\\. What a great season\. .fi .RE .SS Code Blocks .P Pre\-formatted code blocks are used for writing about programming or .br markup source code\. Rather than forming normal paragraphs, the lines .br of a code block are interpreted literally\. Markdown wraps a code block .br in both \fB
\fP and \fB\fP tags\.
.P
To produce a code block in Markdown, simply indent every line of the
.br
block by at least 4 spaces or 1 tab\. For example, given this input:
.RS 2
.nf
This is a normal paragraph:

    This is a code block\.
.fi
.RE
.P
Markdown will generate:
.RS 2
.nf

This is a normal paragraph:

This is a code block\.
.fi .RE .P One level of indentation \-\- 4 spaces or 1 tab \-\- is removed from each .br line of the code block\. For example, this: .RS 2 .nf Here is an example of AppleScript: tell application "Foo" beep end tell .fi .RE .P will turn into: .RS 2 .nf

Here is an example of AppleScript:

tell application "Foo"
    beep
end tell
.fi .RE .P A code block continues until it reaches a line that is not indented .br (or the end of the article)\. .P Within a code block, ampersands (\fB&\fP) and angle brackets (\fB<\fP and \fB>\fP) .br are automatically converted into HTML entities\. This makes it very .br easy to include example HTML source code using Markdown \-\- just paste .br it and indent it, and Markdown will handle the hassle of encoding the .br ampersands and angle brackets\. For example, this: .RS 2 .nf .fi .RE .P will turn into: .RS 2 .nf
<div class="footer">
    &copy; 2004 Foo Corporation
</div>
.fi .RE .P Regular Markdown syntax is not processed within code blocks\. E\.g\., .br asterisks are just literal asterisks within a code block\. This means .br it's also easy to use Markdown to write about Markdown's own syntax\. .SS Horizontal Rules .P You can produce a horizontal rule tag (\fB
\fP) by placing three or .br more hyphens, asterisks, or underscores on a line by themselves\. If you .br wish, you may use spaces between the hyphens or asterisks\. Each of the .br following lines will produce a horizontal rule: .RS 2 .nf * * * *** ***** \- \- \- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- .fi .RE .SH SPAN ELEMENTS .SS Links .P Markdown supports two style of links: \fIinline\fR and \fIreference\fR\|\. .P In both styles, the link text is delimited by [square brackets]\. .P To create an inline link, use a set of regular parentheses immediately .br after the link text's closing square bracket\. Inside the parentheses, .br put the URL where you want the link to point, along with an \fIoptional\fR .br title for the link, surrounded in quotes\. For example: .RS 2 .nf This is [an example](http://example\.com/ "Title") inline link\. [This link](http://example\.net/) has no title attribute\. .fi .RE .P Will produce: .RS 2 .nf

This is an example inline link\.

This link has no title attribute\.

.fi .RE .P If you're referring to a local resource on the same server, you can .br use relative paths: .RS 2 .nf See my [About](/about/) page for details\. .fi .RE .P Reference\-style links use a second set of square brackets, inside .br which you place a label of your choosing to identify the link: .RS 2 .nf This is [an example][id] reference\-style link\. .fi .RE .P You can optionally use a space to separate the sets of brackets: .RS 2 .nf This is [an example] [id] reference\-style link\. .fi .RE .P Then, anywhere in the document, you define your link label like this, .br on a line by itself: .RS 2 .nf [id]: http://example\.com/ "Optional Title Here" .fi .RE .P That is: .RS 1 .IP \(bu 2 Square brackets containing the link identifier (optionally .br indented from the left margin using up to three spaces); .IP \(bu 2 followed by a colon; .IP \(bu 2 followed by one or more spaces (or tabs); .IP \(bu 2 followed by the URL for the link; .IP \(bu 2 optionally followed by a title attribute for the link, enclosed .br in double or single quotes, or enclosed in parentheses\. .RE .P The following three link definitions are equivalent: .RS 2 .nf [foo]: http://example\.com/ "Optional Title Here" [foo]: http://example\.com/ 'Optional Title Here' [foo]: http://example\.com/ (Optional Title Here) .fi .RE .P \fBNote:\fR There is a known bug in Markdown\.pl 1\.0\.1 which prevents .br single quotes from being used to delimit link titles\. .P The link URL may, optionally, be surrounded by angle brackets: .RS 2 .nf [id]: "Optional Title Here" .fi .RE .P You can put the title attribute on the next line and use extra spaces .br or tabs for padding, which tends to look better with longer URLs: .RS 2 .nf [id]: http://example\.com/longish/path/to/resource/here "Optional Title Here" .fi .RE .P Link definitions are only used for creating links during Markdown .br processing, and are stripped from your document in the HTML output\. .P Link definition names may consist of letters, numbers, spaces, and .br punctuation \-\- but they are \fInot\fR case sensitive\. E\.g\. these two .br links: .RS 2 .nf [link text][a] [link text][A] .fi .RE .P are equivalent\. .P The \fIimplicit link name\fR shortcut allows you to omit the name of the .br link, in which case the link text itself is used as the name\. .br Just use an empty set of square brackets \-\- e\.g\., to link the word .br "Google" to the google\.com web site, you could simply write: .RS 2 .nf [Google][] .fi .RE .P And then define the link: .RS 2 .nf [Google]: http://google\.com/ .fi .RE .P Because link names may contain spaces, this shortcut even works for .br multiple words in the link text: .RS 2 .nf Visit [Daring Fireball][] for more information\. .fi .RE .P And then define the link: .RS 2 .nf [Daring Fireball]: http://daringfireball\.net/ .fi .RE .P Link definitions can be placed anywhere in your Markdown document\. I .br tend to put them immediately after each paragraph in which they're .br used, but if you want, you can put them all at the end of your .br document, sort of like footnotes\. .P Here's an example of reference links in action: .RS 2 .nf I get 10 times more traffic from [Google] [1] than from [Yahoo] [2] or [MSN] [3]\. [1]: http://google\.com/ "Google" [2]: http://search\.yahoo\.com/ "Yahoo Search" [3]: http://search\.msn\.com/ "MSN Search" .fi .RE .P Using the implicit link name shortcut, you could instead write: .RS 2 .nf I get 10 times more traffic from [Google][] than from [Yahoo][] or [MSN][]\. [google]: http://google\.com/ "Google" [yahoo]: http://search\.yahoo\.com/ "Yahoo Search" [msn]: http://search\.msn\.com/ "MSN Search" .fi .RE .P Both of the above examples will produce the following HTML output: .RS 2 .nf

I get 10 times more traffic from Google than from Yahoo or MSN\.

.fi .RE .P For comparison, here is the same paragraph written using .br Markdown's inline link style: .RS 2 .nf I get 10 times more traffic from [Google](http://google\.com/ "Google") than from [Yahoo](http://search\.yahoo\.com/ "Yahoo Search") or [MSN](http://search\.msn\.com/ "MSN Search")\. .fi .RE .P The point of reference\-style links is not that they're easier to .br write\. The point is that with reference\-style links, your document .br source is vastly more readable\. Compare the above examples: using .br reference\-style links, the paragraph itself is only 81 characters .br long; with inline\-style links, it's 176 characters; and as raw HTML, .br it's 234 characters\. In the raw HTML, there's more markup than there .br is text\. .P With Markdown's reference\-style links, a source document much more .br closely resembles the final output, as rendered in a browser\. By .br allowing you to move the markup\-related metadata out of the paragraph, .br you can add links without interrupting the narrative flow of your .br prose\. .SS Emphasis .P Markdown treats asterisks (\fB*\fP) and underscores (\fB_\fP) as indicators of .br emphasis\. Text wrapped with one \fB*\fP or \fB_\fP will be wrapped with an .br HTML \fB\fP tag; double \fB*\fP\|'s or \fB_\fP\|'s will be wrapped with an HTML .br \fB\fP tag\. E\.g\., this input: .RS 2 .nf *single asterisks* _single underscores_ **double asterisks** __double underscores__ .fi .RE .P will produce: .RS 2 .nf single asterisks single underscores double asterisks double underscores .fi .RE .P You can use whichever style you prefer; the lone restriction is that .br the same character must be used to open and close an emphasis span\. .P Emphasis can be used in the middle of a word: .RS 2 .nf un*frigging*believable .fi .RE .P But if you surround an \fB*\fP or \fB_\fP with spaces, it'll be treated as a .br literal asterisk or underscore\. .P To produce a literal asterisk or underscore at a position where it .br would otherwise be used as an emphasis delimiter, you can backslash .br escape it: .RS 2 .nf \\*this text is surrounded by literal asterisks\\* .fi .RE .SS Code .P To indicate a span of code, wrap it with backtick quotes (\fB`\fP)\. .br Unlike a pre\-formatted code block, a code span indicates code within a .br normal paragraph\. For example: .RS 2 .nf Use the `printf()` function\. .fi .RE .P will produce: .RS 2 .nf

Use the printf() function\.

.fi .RE .P To include a literal backtick character within a code span, you can use .br multiple backticks as the opening and closing delimiters: .RS 2 .nf ``There is a literal backtick (`) here\.`` .fi .RE .P which will produce this: .RS 2 .nf

There is a literal backtick (`) here\.

.fi .RE .P The backtick delimiters surrounding a code span may include spaces \-\- .br one after the opening, one before the closing\. This allows you to place .br literal backtick characters at the beginning or end of a code span: .RS 2 .nf A single backtick in a code span: `` ` `` A backtick\-delimited string in a code span: `` `foo` `` .fi .RE .P will produce: .RS 2 .nf

A single backtick in a code span: `

A backtick\-delimited string in a code span: `foo`

.fi .RE .P With a code span, ampersands and angle brackets are encoded as HTML .br entities automatically, which makes it easy to include example HTML .br tags\. Markdown will turn this: .RS 2 .nf Please don't use any `` tags\. .fi .RE .P into: .RS 2 .nf

Please don't use any <blink> tags\.

.fi .RE .P You can write this: .RS 2 .nf `—` is the decimal\-encoded equivalent of `—`\. .fi .RE .P to produce: .RS 2 .nf

&#8212; is the decimal\-encoded equivalent of &mdash;\.

.fi .RE .SS Images .P Admittedly, it's fairly difficult to devise a "natural" syntax for .br placing images into a plain text document format\. .P Markdown uses an image syntax that is intended to resemble the syntax .br for links, allowing for two styles: \fIinline\fR and \fIreference\fR\|\. .P Inline image syntax looks like this: .RS 2 .nf ![Alt text](/path/to/img\.jpg) ![Alt text](/path/to/img\.jpg "Optional title") .fi .RE .P That is: .RS 1 .IP \(bu 2 An exclamation mark: \fB!\fP; .IP \(bu 2 followed by a set of square brackets, containing the \fBalt\fP .br attribute text for the image; .IP \(bu 2 followed by a set of parentheses, containing the URL or path to .br the image, and an optional \fBtitle\fP attribute enclosed in double .br or single quotes\. .RE .P Reference\-style image syntax looks like this: .RS 2 .nf ![Alt text][id] .fi .RE .P Where "id" is the name of a defined image reference\. Image references .br are defined using syntax identical to link references: .RS 2 .nf [id]: url/to/image "Optional title attribute" .fi .RE .P As of this writing, Markdown has no syntax for specifying the .br dimensions of an image; if this is important to you, you can simply .br use regular HTML \fB\fP tags\. .SH MISCELLANEOUS .SS Automatic Links .P Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets\. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this: .RS 2 .nf .fi .RE .P Markdown will turn this into: .RS 2 .nf http://example\.com/ .fi .RE .P Automatic links for email addresses work similarly, except that .br Markdown will also perform a bit of randomized decimal and hex .br entity\-encoding to help obscure your address from address\-harvesting .br spambots\. For example, Markdown will turn this: .RS 2 .nf .fi .RE .P into something like this: .RS 2 .nf address@exa mple.com .fi .RE .P which will render in a browser as a clickable link to "address@example.com\|\. .P (This sort of entity\-encoding trick will indeed fool many, if not .br most, address\-harvesting bots, but it definitely won't fool all of .br them\. It's better than nothing, but an address published in this way .br will probably eventually start receiving spam\.) .SS Backslash Escapes .P Markdown allows you to use backslash escapes to generate literal .br characters which would otherwise have special meaning in Markdown's .br formatting syntax\. For example, if you wanted to surround a word .br with literal asterisks (instead of an HTML \fB\fP tag), you can use .br backslashes before the asterisks, like this: .RS 2 .nf \\*literal asterisks\\* .fi .RE .P Markdown provides backslash escapes for the following characters: .RS 2 .nf \\ backslash ` backtick * asterisk _ underscore {} curly braces [] square brackets () parentheses # hash mark + plus sign \- minus sign (hyphen) \|\. dot ! exclamation mark .fi .RE .SH AUTHOR .P Markdown was created by John Gruber\. .P Manual page by Ryan Tomayko\. It's pretty much a direct copy of the .br .UR http://daringfireball.net/projects/markdown/syntax .I Markdown Syntax Reference .UE , .br also by John Gruber\. .SH SEE ALSO .P ronn(5) .br .UR http://daringfireball.net/projects/markdown/ .I Markdown Syntax Reference .UE marked-man-1.3.5/test/man/nested_list_with_code.1000066400000000000000000000010571453653230300217210ustar00rootroot00000000000000.TH "A" "1" "January 1979" .SH "NAME" \fBa\fR .P Tight list: .RS 1 .IP \(bu 2 \fBtoggle_status\fP .RS 1 .IP \(bu 2 Toggle the display of the status bar1 .IP \(bu 2 Toggle the display of the status bar2 .RE .IP \(bu 2 \fBspawn \fP TODO explain path\-alike expansion .RE .P Loose list: .RS 1 .IP \(bu 2 \fBtoggle_status\fP .RS 1 .IP \(bu 2 Toggle the display of the status bar1 .IP \(bu 2 Toggle the display of the status bar2 .RE .IP \(bu 2 \fBspawn \fP TODO explain path\-alike expansion .RE marked-man-1.3.5/test/man/noname.1000066400000000000000000000001351453653230300166300ustar00rootroot00000000000000.TH "TEST" "1" "January 1979" .SH NAME .P test \- a nice test .SH SYNOPSYS .P test is a test marked-man-1.3.5/test/man/pre_block_with_quotes.1000066400000000000000000000001331453653230300217440ustar00rootroot00000000000000.TH "T" "1" "January 1979" .SH "NAME" \fBt\fR \- test .SH test .RS 2 .nf [ "$11" ] .fi .RE marked-man-1.3.5/test/man/regressions.1000066400000000000000000000002741453653230300177220ustar00rootroot00000000000000.TH "REGRESSIONS" "7" "January 1979" .SH "NAME" \fBregressions\fR \- issues .SH inlines .P This should be \fI(a \fBb\fP)\fR ok\. .P This should not double escape \fBpkg\-js\-tools\fR\|\. marked-man-1.3.5/test/man/simple_table.1000066400000000000000000000003021453653230300200070ustar00rootroot00000000000000.TH "SIMPLE_TABLE" "1" "January 1979" .SH "NAME" \fBsimple_table\fR .TS tab(|) expand nowarn box; l c r. T{ Col1 T}|T{ Col2 T}|T{ Col3 T} = T{ A T}|T{ B T}|T{ C T} _ T{ D T}|T{ E T}|T{ F T} .TE marked-man-1.3.5/test/man/table.1000066400000000000000000000043611453653230300164470ustar00rootroot00000000000000.TH "TABLE" "7" "January 1979" .SH "NAME" \fBtable\fR \- test data for table format .P test table copy and paste form www\. .SH LARGE TABLE .P .UR https://en.wikipedia.org/wiki/Comparison_of_file_systems .I Comparison of file systems .UE .TS tab(|) expand nowarn box; l l l l. T{ File system T}|T{ Creator T}|T{ Year of introduction T}|T{ Original operating system T} = T{ DECtape T}|T{ DEC T}|T{ 1964 T}|T{ PDP\-6 Monitor T} _ T{ DASD T}|T{ IBM T}|T{ 1964 T}|T{ OS/360 T} _ T{ Level\-D T}|T{ DEC T}|T{ 1968 T}|T{ TOPS\-10 T} _ T{ George 2 T}|T{ ICT (later ICL) T}|T{ 1968 T}|T{ George 2 T} _ T{ Version 6 Unix file system (V6FS) T}|T{ Bell Labs T}|T{ 1972 T}|T{ Version 6 Unix T} _ T{ RT\-11 file system T}|T{ DEC T}|T{ 1973 T}|T{ RT\-11 T} _ T{ Disk Operating System (GEC DOS) T}|T{ GEC T}|T{ 1973 T}|T{ Core Operating System T} _ T{ CP/M file system T}|T{ Digital Research (Gary Kildall) T}|T{ 1974 T}|T{ CP/M[1] T} _ T{ ODS\-1 T}|T{ DEC T}|T{ 1975 T}|T{ RSX\-11 T} _ T{ GEC DOS filing system extended T}|T{ GEC T}|T{ 1977 T}|T{ OS4000 T} _ T{ FAT (8\-bit) T}|T{ Microsoft (Marc McDonald) for NCR T}|T{ 1977 T}|T{ Microsoft Standalone Disk BASIC\-80 (later Microsoft Standalone Disk BASIC\-86) T} _ T{ DOS 3\.x T}|T{ Apple Computer T}|T{ 1978 T}|T{ Apple DOS T} _ T{ Pascal T}|T{ Apple Computer T}|T{ 1978 T}|T{ Apple Pascal T} _ T{ CBM DOS T}|T{ Commodore T}|T{ 1978 T}|T{ Commodore BASIC T} _ T{ Version 7 Unix file system (V7FS) T}|T{ Bell Labs T}|T{ 1979 T}|T{ Version 7 Unix T} _ T{ ODS\-2 T}|T{ DEC T}|T{ 1979 T}|T{ OpenVMS T} .TE .SH LONG TEXT .TS tab(|) expand nowarn box; l l l. T{ Person T}|T{ Work T}|T{ Quote T} = T{ Sherlock Holmes T}|T{ The Norwood Builder T}|T{ You mentioned your name as if I should recognize it, but beyond the obvious facts that you are a bachelor, a solicitor, a freemason, and an asthmatic, I know nothing whatever about you\. T} .TE .SH THING TABLE .TS tab(|) expand nowarn box; l l. T{ 1 T}|T{ 2 T} = T{ 1 T}|T{ 2 T} _ T{ 1 T}|T{ 2 T} _ T{ 1 T}|T{ 2 T} _ T{ 1 T}|T{ 2 T} _ T{ 1 T}|T{ 2 T} _ T{ T{1 T}|T{ 2 T} _ T{ 1 T}|T{ 2 T} _ T{ 1 T}|T{ 2 T} _ T{ 1 T}|T{ 2 T} _ T{ 1 T}|T{ 2 T} _ T{ 1 T}|T{ 2 T} _ T{ 1 T}|T{ 2 T} _ T{ 1 T}|T{ 2 T} _ T{ 1 T}|T{ 2 T} _ T{ 1 T}|T{ 2 T} _ T{ 1 T}|T{ 2 T} _ T{ 1 T}|T{ 2 T} _ T{ 1 T}|T{ 2 T} _ T{ 1 T}|T{ 2 T} .TE marked-man-1.3.5/test/man/underline_spacing_test.1000066400000000000000000000005541453653230300221100ustar00rootroot00000000000000.TH "UNDERLINE_SPACING_TEST" "1" "January 1979" .SH "NAME" \fBunderline_spacing_test\fR .RS 1 .IP \(bu 2 \fB\-S\fP \fItext\fR, \fBsearch\fP \fItext\fR: .br Performs a substring search of formula names for \fItext\fR\|\. .IP \(bu 2 \fB\-O\fP , \fBother\fP : .br Does something else\. .RE .P Should space text properly\. marked-man-1.3.5/test/md/000077500000000000000000000000001453653230300151175ustar00rootroot00000000000000marked-man-1.3.5/test/md/blockquotes.md000066400000000000000000000003411453653230300177720ustar00rootroot00000000000000t(1) - test =========== ## test A blockquote here. Continuing on second line. Hello. > Another block quote. With a long title. That will break a line eventually later. that continues on second line > continuation marked-man-1.3.5/test/md/definition_list_syntax.md000066400000000000000000000004421453653230300222320ustar00rootroot00000000000000defition_list_syntax(5) -- hiya =============================== Definition lists look like unordered lists: * term: definition * another one: The definition may span multiple lines and even start new paragraphs * `--somearg`=: We can do that too. marked-man-1.3.5/test/md/dots_at_line_start_test.md000066400000000000000000000002011453653230300223520ustar00rootroot00000000000000There's a weird issue where dots at the beginning of a line generate troff warnings due to escaping. .. let's see what happens. marked-man-1.3.5/test/md/ellipses.md000066400000000000000000000002611453653230300172600ustar00rootroot00000000000000ellipses(7) -- testing ellipses =============================== Ellipses should be replaced... ...also, they shouldn't interfere with regular dots at the beginning of a line. marked-man-1.3.5/test/md/entity_encoding_test.md000066400000000000000000000011711453653230300216620ustar00rootroot00000000000000# hello(1) -- hello world Your output <i>might</i> look like this: * Chris * * <b>GitHub</b> * GitHub Here's some special entities: * &bull; • * &nbsp;   * &copy; © * &rdquo; ” * &mdash; — * &reg; ® * &sect; § * &ge; ≥ * &le; ≤ * &ne; ≠ * &equiv; ≡ * &plusmn; ± Here's a line that uses non-breaking spaces to force the last few words to wrap together. marked-man-1.3.5/test/md/escapes.md000066400000000000000000000006121453653230300170630ustar00rootroot00000000000000# escapes tests backslashes before the asterisks, like this: \*literal asterisks\* Markdown provides backslash escapes for the following characters: \ backslash ` backtick * asterisk _ underscore {} curly braces [] square brackets () parentheses # hash mark + plus sign - minus sign (hyphen) . dot ! exclamation mark marked-man-1.3.5/test/md/graves.md000066400000000000000000000001121453653230300167220ustar00rootroot00000000000000test ==== ## this title `will render` strangely This is the body text. marked-man-1.3.5/test/md/links.md000066400000000000000000000012541453653230300165630ustar00rootroot00000000000000I get 10 times more traffic from [Google][1] than from [Yahoo][2] or [MSN][3]. [1]: http://google.com/ "Google" [2]: http://search.yahoo.com/ "Yahoo Search" [3]: http://search.msn.com/ "MSN Search" This is to test proper escape of html chars and non-repeating link: I get 10 times more traffic from [Google][] than from [Yahoo][] or [MSN][]. [google]: http://google.com/ "Google" [yahoo]: http://search.yahoo.com/ "Yahoo Search" [msn]: http://search.msn.com/ "MSN Search" Non-repeating http link Also [Google](http://google.com/ "Google") and [local links should not crash](./table.md) marked-man-1.3.5/test/md/list.md000066400000000000000000000005101453653230300164100ustar00rootroot00000000000000a(1) ==== This is a tight list: * `toggle_status`: test * `spawn ` TODO explain path-alike expansion, ability to get a block here. This is a loose list: * `toggle_status`: test * `spawn `: TODO explain path-alike expansion, ability to get a block here. marked-man-1.3.5/test/md/markdown_syntax.md000066400000000000000000000654451453653230300207070ustar00rootroot00000000000000markdown(5) -- humane markup syntax =================================== ## SYNOPSIS # Header 1 # ## Header 2 ## ### Header 3 ### (Hashes on right are optional) #### Header 4 #### ##### Header 5 ##### This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one line (or many), and can drone on for hours. [Reference style links][1] and [inline links](http://example.com) [1]: http://example.com "Title is optional" Inline markup like _italics_, **bold**, and `code()`. ![picture alt](/images/photo.jpeg "Title is optional") > Blockquotes are like quoted text in email replies >> And, they can be nested code blocks are for preformatted text and must be indented with four spaces * Bullet lists are easy too * You can * even * nest them - Another one + Another one ## DESCRIPTION ### Philosophy Markdown is intended to be as easy-to-read and easy-to-write as is feasible. Readability, however, is emphasized above all else. A Markdown-formatted document should be publishable as-is, as plain text, without looking like it's been marked up with tags or formatting instructions. While Markdown's syntax has been influenced by several existing text-to-HTML filters -- including [Setext][1], [atx][2], [Textile][3], [reStructuredText][4], [Grutatext][5], and [EtText][6] -- the single biggest source of inspiration for Markdown's syntax is the format of plain text email. [1]: http://docutils.sourceforge.net/mirror/setext.html [2]: http://www.aaronsw.com/2002/atx/ [3]: http://textism.com/tools/textile/ [4]: http://docutils.sourceforge.net/rst.html [5]: http://www.triptico.com/software/grutatxt.html [6]: http://ettext.taint.org/doc/ To this end, Markdown's syntax is comprised entirely of punctuation characters, which punctuation characters have been carefully chosen so as to look like what they mean. E.g., asterisks around a word actually look like \*emphasis\*. Markdown lists look like, well, lists. Even blockquotes look like quoted passages of text, assuming you've ever used email. ### Inline HTML Markdown's syntax is intended for one purpose: to be used as a format for *writing* for the web. Markdown is not a replacement for HTML, or even close to it. Its syntax is very small, corresponding only to a very small subset of HTML tags. The idea is *not* to create a syntax that makes it easier to insert HTML tags. In my opinion, HTML tags are already easy to insert. The idea for Markdown is to make it easy to read, write, and edit prose. HTML is a *publishing* format; Markdown is a *writing* format. Thus, Markdown's formatting syntax only addresses issues that can be conveyed in plain text. For any markup that is not covered by Markdown's syntax, you simply use HTML itself. There's no need to preface it or delimit it to indicate that you're switching from Markdown to HTML; you just use the tags. The only restrictions are that block-level HTML elements -- e.g. `
`, ``, `
`, `

`, etc. -- must be separated from surrounding content by blank lines, and the start and end tags of the block should not be indented with tabs or spaces. Markdown is smart enough not to add extra (unwanted) `

` tags around HTML block-level tags. For example, to add an HTML table to a Markdown article: This is a regular paragraph.

Foo
This is another regular paragraph. Note that Markdown formatting syntax is not processed within block-level HTML tags. E.g., you can't use Markdown-style `*emphasis*` inside an HTML block. Span-level HTML tags -- e.g. ``, ``, or `` -- can be used anywhere in a Markdown paragraph, list item, or header. If you want, you can even use HTML tags instead of Markdown formatting; e.g. if you'd prefer to use HTML `` or `` tags instead of Markdown's link or image syntax, go right ahead. Unlike block-level HTML tags, Markdown syntax *is* processed within span-level tags. ### Automatic Escaping for Special Characters In HTML, there are two characters that demand special treatment: `<` and `&`. Left angle brackets are used to start tags; ampersands are used to denote HTML entities. If you want to use them as literal characters, you must escape them as entities, e.g. `<`, and `&`. Ampersands in particular are bedeviling for web writers. If you want to write about 'AT&T', you need to write '`AT&T`'. You even need to escape ampersands within URLs. Thus, if you want to link to: http://images.google.com/images?num=30&q=larry+bird you need to encode the URL as: http://images.google.com/images?num=30&q=larry+bird in your anchor tag `href` attribute. Needless to say, this is easy to forget, and is probably the single most common source of HTML validation errors in otherwise well-marked-up web sites. Markdown allows you to use these characters naturally, taking care of all the necessary escaping for you. If you use an ampersand as part of an HTML entity, it remains unchanged; otherwise it will be translated into `&`. So, if you want to include a copyright symbol in your article, you can write: © and Markdown will leave it alone. But if you write: AT&T Markdown will translate it to: AT&T Similarly, because Markdown supports [inline HTML](#html), if you use angle brackets as delimiters for HTML tags, Markdown will treat them as such. But if you write: 4 < 5 Markdown will translate it to: 4 < 5 However, inside Markdown code spans and blocks, angle brackets and ampersands are *always* encoded automatically. This makes it easy to use Markdown to write about HTML code. (As opposed to raw HTML, which is a terrible format for writing about HTML syntax, because every single `<` and `&` in your example code needs to be escaped.) ## BLOCK ELEMENTS ### Paragraphs and Line Breaks A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines. (A blank line is any line that looks like a blank line -- a line containing nothing but spaces or tabs is considered blank.) Normal paragraphs should not be indented with spaces or tabs. The implication of the "one or more consecutive lines of text" rule is that Markdown supports "hard-wrapped" text paragraphs. This differs significantly from most other text-to-HTML formatters (including Movable Type's "Convert Line Breaks" option) which translate every line break character in a paragraph into a `
` tag. When you *do* want to insert a `
` break tag using Markdown, you end a line with two or more spaces, then type return. Yes, this takes a tad more effort to create a `
`, but a simplistic "every line break is a `
`" rule wouldn't work for Markdown. Markdown's email-style [blockquoting][bq] and multi-paragraph [list items][l] work best -- and look better -- when you format them with hard breaks. [bq]: #blockquote [l]: #list ### Headers Markdown supports two styles of headers, [Setext] [1] and [atx] [2]. Setext-style headers are "underlined" using equal signs (for first-level headers) and dashes (for second-level headers). For example: This is an H1 ============= This is an H2 ------------- Any number of underlining `=`'s or `-`'s will work. Atx-style headers use 1-6 hash characters at the start of the line, corresponding to header levels 1-6. For example: # This is an H1 ## This is an H2 ###### This is an H6 Optionally, you may "close" atx-style headers. This is purely cosmetic -- you can use this if you think it looks better. The closing hashes don't even need to match the number of hashes used to open the header. (The number of opening hashes determines the header level.) : # This is an H1 # ## This is an H2 ## ### This is an H3 ###### ### Blockquotes Markdown uses email-style `>` characters for blockquoting. If you're familiar with quoting passages of text in an email message, then you know how to create a blockquote in Markdown. It looks best if you hard wrap the text and put a `>` before every line: > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. > > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse > id sem consectetuer libero luctus adipiscing. Markdown allows you to be lazy and only put the `>` before the first line of a hard-wrapped paragraph: > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing. Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by adding additional levels of `>`: > This is the first level of quoting. > > > This is nested blockquote. > > Back to the first level. Blockquotes can contain other Markdown elements, including headers, lists, and code blocks: > ## This is a header. > > 1. This is the first list item. > 2. This is the second list item. > > Here's some example code: > > return shell_exec("echo $input | $markdown_script"); Any decent text editor should make email-style quoting easy. For example, with BBEdit, you can make a selection and choose Increase Quote Level from the Text menu. ### Lists Markdown supports ordered (numbered) and unordered (bulleted) lists. Unordered lists use asterisks, pluses, and hyphens -- interchangably -- as list markers: * Red * Green * Blue is equivalent to: + Red + Green + Blue and: - Red - Green - Blue Ordered lists use numbers followed by periods: 1. Bird 2. McHale 3. Parish It's important to note that the actual numbers you use to mark the list have no effect on the HTML output Markdown produces. The HTML Markdown produces from the above list is:
  1. Bird
  2. McHale
  3. Parish
If you instead wrote the list in Markdown like this: 1. Bird 1. McHale 1. Parish or even: 3. Bird 1. McHale 8. Parish you'd get the exact same HTML output. The point is, if you want to, you can use ordinal numbers in your ordered Markdown lists, so that the numbers in your source match the numbers in your published HTML. But if you want to be lazy, you don't have to. If you do use lazy list numbering, however, you should still start the list with the number 1. At some point in the future, Markdown may support starting ordered lists at an arbitrary number. List markers typically start at the left margin, but may be indented by up to three spaces. List markers must be followed by one or more spaces or a tab. To make lists look nice, you can wrap items with hanging indents: * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing. But if you want to be lazy, you don't have to: * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing. If list items are separated by blank lines, Markdown will wrap the items in `

` tags in the HTML output. For example, this input: * Bird * Magic will turn into:

  • Bird
  • Magic
But this: * Bird * Magic will turn into:
  • Bird

  • Magic

List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be indented by either 4 spaces or one tab: 1. This is a list item with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. Donec sit amet nisl. Aliquam semper ipsum sit amet velit. 2. Suspendisse id sem consectetuer libero luctus adipiscing. It looks nice if you indent every line of the subsequent paragraphs, but here again, Markdown will allow you to be lazy: * This is a list item with two paragraphs. This is the second paragraph in the list item. You're only required to indent the first line. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. * Another item in the same list. To put a blockquote within a list item, the blockquote's `>` delimiters need to be indented: * A list item with a blockquote: > This is a blockquote > inside a list item. To put a code block within a list item, the code block needs to be indented *twice* -- 8 spaces or two tabs: * A list item with a code block: It's worth noting that it's possible to trigger an ordered list by accident, by writing something like this: 1986. What a great season. In other words, a *number-period-space* sequence at the beginning of a line. To avoid this, you can backslash-escape the period: 1986\. What a great season. ### Code Blocks Pre-formatted code blocks are used for writing about programming or markup source code. Rather than forming normal paragraphs, the lines of a code block are interpreted literally. Markdown wraps a code block in both `
` and `` tags.

To produce a code block in Markdown, simply indent every line of the
block by at least 4 spaces or 1 tab. For example, given this input:

    This is a normal paragraph:

        This is a code block.

Markdown will generate:

    

This is a normal paragraph:

This is a code block.
    
One level of indentation -- 4 spaces or 1 tab -- is removed from each line of the code block. For example, this: Here is an example of AppleScript: tell application "Foo" beep end tell will turn into:

Here is an example of AppleScript:

tell application "Foo"
        beep
    end tell
    
A code block continues until it reaches a line that is not indented (or the end of the article). Within a code block, ampersands (`&`) and angle brackets (`<` and `>`) are automatically converted into HTML entities. This makes it very easy to include example HTML source code using Markdown -- just paste it and indent it, and Markdown will handle the hassle of encoding the ampersands and angle brackets. For example, this: will turn into:
<div class="footer">
        &copy; 2004 Foo Corporation
    </div>
    
Regular Markdown syntax is not processed within code blocks. E.g., asterisks are just literal asterisks within a code block. This means it's also easy to use Markdown to write about Markdown's own syntax. ### Horizontal Rules You can produce a horizontal rule tag (`
`) by placing three or more hyphens, asterisks, or underscores on a line by themselves. If you wish, you may use spaces between the hyphens or asterisks. Each of the following lines will produce a horizontal rule: * * * *** ***** - - - --------------------------------------- ## SPAN ELEMENTS ### Links Markdown supports two style of links: *inline* and *reference*. In both styles, the link text is delimited by [square brackets]. To create an inline link, use a set of regular parentheses immediately after the link text's closing square bracket. Inside the parentheses, put the URL where you want the link to point, along with an *optional* title for the link, surrounded in quotes. For example: This is [an example](http://example.com/ "Title") inline link. [This link](http://example.net/) has no title attribute. Will produce:

This is an example inline link.

This link has no title attribute.

If you're referring to a local resource on the same server, you can use relative paths: See my [About](/about/) page for details. Reference-style links use a second set of square brackets, inside which you place a label of your choosing to identify the link: This is [an example][id] reference-style link. You can optionally use a space to separate the sets of brackets: This is [an example] [id] reference-style link. Then, anywhere in the document, you define your link label like this, on a line by itself: [id]: http://example.com/ "Optional Title Here" That is: * Square brackets containing the link identifier (optionally indented from the left margin using up to three spaces); * followed by a colon; * followed by one or more spaces (or tabs); * followed by the URL for the link; * optionally followed by a title attribute for the link, enclosed in double or single quotes, or enclosed in parentheses. The following three link definitions are equivalent: [foo]: http://example.com/ "Optional Title Here" [foo]: http://example.com/ 'Optional Title Here' [foo]: http://example.com/ (Optional Title Here) **Note:** There is a known bug in Markdown.pl 1.0.1 which prevents single quotes from being used to delimit link titles. The link URL may, optionally, be surrounded by angle brackets: [id]: "Optional Title Here" You can put the title attribute on the next line and use extra spaces or tabs for padding, which tends to look better with longer URLs: [id]: http://example.com/longish/path/to/resource/here "Optional Title Here" Link definitions are only used for creating links during Markdown processing, and are stripped from your document in the HTML output. Link definition names may consist of letters, numbers, spaces, and punctuation -- but they are *not* case sensitive. E.g. these two links: [link text][a] [link text][A] are equivalent. The *implicit link name* shortcut allows you to omit the name of the link, in which case the link text itself is used as the name. Just use an empty set of square brackets -- e.g., to link the word "Google" to the google.com web site, you could simply write: [Google][] And then define the link: [Google]: http://google.com/ Because link names may contain spaces, this shortcut even works for multiple words in the link text: Visit [Daring Fireball][] for more information. And then define the link: [Daring Fireball]: http://daringfireball.net/ Link definitions can be placed anywhere in your Markdown document. I tend to put them immediately after each paragraph in which they're used, but if you want, you can put them all at the end of your document, sort of like footnotes. Here's an example of reference links in action: I get 10 times more traffic from [Google] [1] than from [Yahoo] [2] or [MSN] [3]. [1]: http://google.com/ "Google" [2]: http://search.yahoo.com/ "Yahoo Search" [3]: http://search.msn.com/ "MSN Search" Using the implicit link name shortcut, you could instead write: I get 10 times more traffic from [Google][] than from [Yahoo][] or [MSN][]. [google]: http://google.com/ "Google" [yahoo]: http://search.yahoo.com/ "Yahoo Search" [msn]: http://search.msn.com/ "MSN Search" Both of the above examples will produce the following HTML output:

I get 10 times more traffic from Google than from Yahoo or MSN.

For comparison, here is the same paragraph written using Markdown's inline link style: I get 10 times more traffic from [Google](http://google.com/ "Google") than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or [MSN](http://search.msn.com/ "MSN Search"). The point of reference-style links is not that they're easier to write. The point is that with reference-style links, your document source is vastly more readable. Compare the above examples: using reference-style links, the paragraph itself is only 81 characters long; with inline-style links, it's 176 characters; and as raw HTML, it's 234 characters. In the raw HTML, there's more markup than there is text. With Markdown's reference-style links, a source document much more closely resembles the final output, as rendered in a browser. By allowing you to move the markup-related metadata out of the paragraph, you can add links without interrupting the narrative flow of your prose. ### Emphasis Markdown treats asterisks (`*`) and underscores (`_`) as indicators of emphasis. Text wrapped with one `*` or `_` will be wrapped with an HTML `` tag; double `*`'s or `_`'s will be wrapped with an HTML `` tag. E.g., this input: *single asterisks* _single underscores_ **double asterisks** __double underscores__ will produce: single asterisks single underscores double asterisks double underscores You can use whichever style you prefer; the lone restriction is that the same character must be used to open and close an emphasis span. Emphasis can be used in the middle of a word: un*frigging*believable But if you surround an `*` or `_` with spaces, it'll be treated as a literal asterisk or underscore. To produce a literal asterisk or underscore at a position where it would otherwise be used as an emphasis delimiter, you can backslash escape it: \*this text is surrounded by literal asterisks\* ### Code To indicate a span of code, wrap it with backtick quotes (`` ` ``). Unlike a pre-formatted code block, a code span indicates code within a normal paragraph. For example: Use the `printf()` function. will produce:

Use the printf() function.

To include a literal backtick character within a code span, you can use multiple backticks as the opening and closing delimiters: ``There is a literal backtick (`) here.`` which will produce this:

There is a literal backtick (`) here.

The backtick delimiters surrounding a code span may include spaces -- one after the opening, one before the closing. This allows you to place literal backtick characters at the beginning or end of a code span: A single backtick in a code span: `` ` `` A backtick-delimited string in a code span: `` `foo` `` will produce:

A single backtick in a code span: `

A backtick-delimited string in a code span: `foo`

With a code span, ampersands and angle brackets are encoded as HTML entities automatically, which makes it easy to include example HTML tags. Markdown will turn this: Please don't use any `` tags. into:

Please don't use any <blink> tags.

You can write this: `—` is the decimal-encoded equivalent of `—`. to produce:

&#8212; is the decimal-encoded equivalent of &mdash;.

### Images Admittedly, it's fairly difficult to devise a "natural" syntax for placing images into a plain text document format. Markdown uses an image syntax that is intended to resemble the syntax for links, allowing for two styles: *inline* and *reference*. Inline image syntax looks like this: ![Alt text](/path/to/img.jpg) ![Alt text](/path/to/img.jpg "Optional title") That is: * An exclamation mark: `!`; * followed by a set of square brackets, containing the `alt` attribute text for the image; * followed by a set of parentheses, containing the URL or path to the image, and an optional `title` attribute enclosed in double or single quotes. Reference-style image syntax looks like this: ![Alt text][id] Where "id" is the name of a defined image reference. Image references are defined using syntax identical to link references: [id]: url/to/image "Optional title attribute" As of this writing, Markdown has no syntax for specifying the dimensions of an image; if this is important to you, you can simply use regular HTML `` tags. ## MISCELLANEOUS ### Automatic Links Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this: Markdown will turn this into: http://example.com/ Automatic links for email addresses work similarly, except that Markdown will also perform a bit of randomized decimal and hex entity-encoding to help obscure your address from address-harvesting spambots. For example, Markdown will turn this: into something like this: address@exa mple.com which will render in a browser as a clickable link to "address@example.com". (This sort of entity-encoding trick will indeed fool many, if not most, address-harvesting bots, but it definitely won't fool all of them. It's better than nothing, but an address published in this way will probably eventually start receiving spam.) ### Backslash Escapes Markdown allows you to use backslash escapes to generate literal characters which would otherwise have special meaning in Markdown's formatting syntax. For example, if you wanted to surround a word with literal asterisks (instead of an HTML `` tag), you can use backslashes before the asterisks, like this: \*literal asterisks\* Markdown provides backslash escapes for the following characters: \ backslash ` backtick * asterisk _ underscore {} curly braces [] square brackets () parentheses # hash mark + plus sign - minus sign (hyphen) . dot ! exclamation mark ## AUTHOR Markdown was created by John Gruber. Manual page by Ryan Tomayko. It's pretty much a direct copy of the [Markdown Syntax Reference](http://daringfireball.net/projects/markdown/syntax), also by John Gruber. ## SEE ALSO ronn(5) [Markdown Syntax Reference](http://daringfireball.net/projects/markdown/) marked-man-1.3.5/test/md/nested_list_with_code.md000066400000000000000000000006121453653230300220020ustar00rootroot00000000000000a(1) ==== Tight list: * `toggle_status` * Toggle the display of the status bar1 * Toggle the display of the status bar2 * `spawn ` TODO explain path-alike expansion Loose list: * `toggle_status` * Toggle the display of the status bar1 * Toggle the display of the status bar2 * `spawn ` TODO explain path-alike expansion marked-man-1.3.5/test/md/noname.md000066400000000000000000000001011453653230300167060ustar00rootroot00000000000000# test ## NAME test - a nice test ## SYNOPSYS test is a test marked-man-1.3.5/test/md/pre_block_with_quotes.md000066400000000000000000000000601453653230300220300ustar00rootroot00000000000000t(1) - test =========== ## test [ "$11" ] marked-man-1.3.5/test/md/regressions.md000066400000000000000000000001701453653230300200020ustar00rootroot00000000000000# regressions(7) -- issues ## inlines This should be _(a `b`)_ ok. This should not double escape **pkg-js-tools**. marked-man-1.3.5/test/md/simple_table.md000066400000000000000000000000721453653230300201000ustar00rootroot00000000000000# simple table Col1|Col2|Col3 ----|:--:|---: A|B|C D|E|F marked-man-1.3.5/test/md/table.md000066400000000000000000000027701453653230300165360ustar00rootroot00000000000000table(7) -- test data for table format ====================================== test table copy and paste form www. LARGE TABLE ----------- [Comparison of file systems](https://en.wikipedia.org/wiki/Comparison_of_file_systems) File system |Creator |Year of introduction |Original operating system ------------|--------|---------------------|--------------- DECtape |DEC |1964 |PDP-6 Monitor DASD |IBM |1964 |OS/360 Level-D |DEC |1968 |TOPS-10 George 2 |ICT (later ICL) |1968 |George 2 Version 6 Unix file system (V6FS) |Bell Labs |1972 |Version 6 Unix RT-11 file system |DEC |1973 |RT-11 Disk Operating System (GEC DOS) |GEC |1973 |Core Operating System CP/M file system |Digital Research (Gary Kildall) |1974 |CP/M[1] ODS-1 |DEC |1975 |RSX-11 GEC DOS filing system extended |GEC |1977 |OS4000 FAT (8-bit) |Microsoft (Marc McDonald) for NCR |1977 |Microsoft Standalone Disk BASIC-80 (later Microsoft Standalone Disk BASIC-86) DOS 3.x |Apple Computer |1978 |Apple DOS Pascal |Apple Computer |1978 |Apple Pascal CBM DOS |Commodore |1978 |Commodore BASIC Version 7 Unix file system (V7FS) |Bell Labs |1979 |Version 7 Unix ODS-2 |DEC |1979 |OpenVMS LONG TEXT --------- Person|Work|Quote -|-|- Sherlock Holmes|The Norwood Builder| You mentioned your name as if I should recognize it, but beyond the obvious facts that you are a bachelor, a solicitor, a freemason, and an asthmatic, I know nothing whatever about you. THING TABLE ----------- 1|2 -|- 1|2 1|2 1|2 1|2 1|2 T{1|2 1|2 1|2 1|2 1|2 1|2 1|2 1|2 1|2 1|2 1|2 1|2 1|2 1|2 marked-man-1.3.5/test/md/underline_spacing_test.md000066400000000000000000000003371453653230300221740ustar00rootroot00000000000000# This input * `-S` _text_, `search` _text_: Performs a substring search of formula names for _text_. * `-O` , `other` : Does something else. Should space text properly. marked-man-1.3.5/test/out/000077500000000000000000000000001453653230300153265ustar00rootroot00000000000000marked-man-1.3.5/test/out/blockquotes.out000066400000000000000000000007651453653230300204220ustar00rootroot00000000000000T(1) General Commands Manual T(1) NAME t - test test A blockquote here. Continuing on second line. Hello. Another block quote. With a long title. That will break a line eventually later. that continues on second line continuation January 1979 T(1) marked-man-1.3.5/test/out/definition_list_syntax.out000066400000000000000000000010361453653230300226500ustar00rootroot00000000000000DEFITION_LIST_SYNTAX(5) File Formats Manual DEFITION_LIST_SYNTAX(5) NAME defition_list_syntax - hiya Definition lists look like unordered lists: • term: definition • another one: The definition may span multiple lines and even start new paragraphs • --somearg=: We can do that too. January 1979 DEFITION_LIST_SYNTAX(5) marked-man-1.3.5/test/out/dots_at_line_start_test.out000066400000000000000000000006061453653230300230010ustar00rootroot00000000000000DOTS_AT_LINE_START_TEST(1) General Commands Manual DOTS_AT_LINE_START_TEST(1) NAME dots_at_line_start_test There's a weird issue where dots at the beginning of a line generate troff warnings due to escaping. .. let's see what happens. January 1979 DOTS_AT_LINE_START_TEST(1) marked-man-1.3.5/test/out/ellipses.out000066400000000000000000000005721453653230300177030ustar00rootroot00000000000000ELLIPSES(7) Miscellaneous Information Manual ELLIPSES(7) NAME ellipses - testing ellipses Ellipses should be replaced... ...also, they shouldn't interfere with regular dots at the beginning of a line. January 1979 ELLIPSES(7) marked-man-1.3.5/test/out/entity_encoding_test.out000066400000000000000000000015361453653230300223050ustar00rootroot00000000000000HELLO(1) General Commands Manual HELLO(1) NAME hello - hello world Your output might look like this: * Chris * * <b>GitHub</b> * GitHub Here's some special entities: • • ○ •   • © © • ” \ • — — • ® ® • § § • ≥ ≥ • ≤ ≤ • ≠ ≠ • ≡ ≡ • ± ± Here's a line that uses non-breaking spaces to force the last few words to wrap together. January 1979 HELLO(1) marked-man-1.3.5/test/out/escapes.out000066400000000000000000000012461453653230300175050ustar00rootroot00000000000000ESCAPES(1) General Commands Manual ESCAPES(1) NAME escapes backslashes before the asterisks, like this: \*literal asterisks\* Markdown provides backslash escapes for the following characters: \ backslash ` backtick * asterisk _ underscore {} curly braces [] square brackets () parentheses # hash mark + plus sign - minus sign (hyphen) . dot ! exclamation mark January 1979 ESCAPES(1) marked-man-1.3.5/test/out/graves.out000066400000000000000000000004441453653230300173500ustar00rootroot00000000000000TEST(1) General Commands Manual TEST(1) NAME test this title will render strangely This is the body text. January 1979 TEST(1) marked-man-1.3.5/test/out/links.out000066400000000000000000000020331453653230300171750ustar00rootroot00000000000000LINKS(1) General Commands Manual LINKS(1) NAME links I get 10 times more traffic from ]8;;http://google.com/\Google]8;;\ than from ]8;;http://search.yahoo.com/\Yahoo Search]8;;\ or ]8;;http://search.msn.com/\MSN Search]8;;\. This is to test proper escape of html chars and non-repeating link: xxxxx@xxxx.xxxx.xxxx.xx I get 10 times more traffic from ]8;;http://google.com/\Google]8;;\ than from ]8;;http://search.yahoo.com/\Yahoo Search]8;;\ or ]8;;http://search.msn.com/\MSN Search]8;;\. Non-repeating http link https://example.com/test Also ]8;;http://google.com/\Google]8;;\ and ]8;;./table.md\local links should not crash]8;;\ January 1979 LINKS(1) marked-man-1.3.5/test/out/list.out000066400000000000000000000012211453653230300170260ustar00rootroot00000000000000A(1) General Commands Manual A(1) NAME a This is a tight list: • toggle_status: test • spawn  TODO explain path-alike expansion, ability to get a block here. This is a loose list: • toggle_status: test • spawn : TODO explain path-alike expansion, ability to get a block here. January 1979 A(1) marked-man-1.3.5/test/out/markdown_syntax.out000066400000000000000000000764231453653230300213230ustar00rootroot00000000000000MARKDOWN(5) File Formats Manual MARKDOWN(5) NAME markdown - humane markup syntax SYNOPSIS # Header 1 # ## Header 2 ## ### Header 3 ### (Hashes on right are optional) #### Header 4 #### ##### Header 5 ##### This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one line (or many), and can drone on for hours. [Reference style links][1] and [inline links](http://example.com) [1]: http://example.com "Title is optional" Inline markup like _italics_, **bold**, and `code()`. ![picture alt](/images/photo.jpeg "Title is optional") > Blockquotes are like quoted text in email replies >> And, they can be nested code blocks are for preformatted text and must be indented with four spaces * Bullet lists are easy too * You can * even * nest them - Another one + Another one DESCRIPTION Philosophy Markdown is intended to be as easy-to-read and easy-to-write as is fea‐ sible. Readability, however, is emphasized above all else. A Markdown-format‐ ted document should be publishable as-is, as plain text, without looking like it's been marked up with tags or formatting instructions. While Markdown's syntax has been influenced by several existing text-to-HTML filters -- including ]8;;http://docutils.sourceforge.net/mirror/setext.html\Setext]8;;\, ]8;;http://www.aaronsw.com/2002/atx/\atx]8;;\, ]8;;http://textism.com/tools/textile/\Textile]8;;\, ]8;;http://docutils.sourceforge.net/rst.html\reStructuredText]8;;\, ]8;;http://www.triptico.com/software/grutatxt.html\Grutatext]8;;\, and ]8;;http://ettext.taint.org/doc/\EtText]8;;\ -- the single biggest source of inspiration for Markdown's syntax is the format of plain text email. To this end, Markdown's syntax is comprised entirely of punctuation characters, which punctuation characters have been carefully chosen so as to look like what they mean. E.g., asterisks around a word actually look like *emphasis*. Markdown lists look like, well, lists. Even blockquotes look like quoted passages of text, assuming you've ever used email. Inline HTML Markdown's syntax is intended for one purpose: to be used as a format for writing for the web. Markdown is not a replacement for HTML, or even close to it. Its syntax is very small, corresponding only to a very small subset of HTML tags. The idea is not to create a syntax that makes it easier to insert HTML tags. In my opinion, HTML tags are already easy to insert. The idea for Markdown is to make it easy to read, write, and edit prose. HTML is a publishing format; Markdown is a writing format. Thus, Markdown's formatting syntax only addresses issues that can be conveyed in plain text. For any markup that is not covered by Markdown's syntax, you simply use HTML itself. There's no need to preface it or delimit it to indicate that you're switching from Markdown to HTML; you just use the tags. The only restrictions are that block-level HTML elements -- e.g. 
, , 
, 

, etc. -- must be separated from surrounding content by blank lines, and the start and end tags of the block should not be indented with tabs or spaces. Markdown is smart enough not to add extra (unwanted) 

tags around HTML block-level tags. For example, to add an HTML table to a Markdown article: This is a regular paragraph.

Foo
This is another regular paragraph. Note that Markdown formatting syntax is not processed within block-level HTML tags. E.g., you can't use Markdown-style *emphasis* inside an HTML block. Span-level HTML tags -- e.g. , , or  -- can be used anywhere in a Markdown paragraph, list item, or header. If you want, you can even use HTML tags instead of Markdown formatting; e.g. if you'd prefer to use HTML  or  tags instead of Markdown's link or image syntax, go right ahead. Unlike block-level HTML tags, Markdown syntax is processed within span-level tags. Automatic Escaping for Special Characters In HTML, there are two characters that demand special treatment: < and &. Left angle brackets are used to start tags; ampersands are used to denote HTML entities. If you want to use them as literal characters, you must escape them as entities, e.g. <, and &. Ampersands in particular are bedeviling for web writers. If you want to write about 'AT&T', you need to write 'AT&T'. You even need to escape ampersands within URLs. Thus, if you want to link to: http://images.google.com/images?num=30&q=larry+bird you need to encode the URL as: http://images.google.com/images?num=30&q=larry+bird in your anchor tag href attribute. Needless to say, this is easy to forget, and is probably the single most common source of HTML valida‐ tion errors in otherwise well-marked-up web sites. Markdown allows you to use these characters naturally, taking care of all the necessary escaping for you. If you use an ampersand as part of an HTML entity, it remains unchanged; otherwise it will be translated into &. So, if you want to include a copyright symbol in your article, you can write: © and Markdown will leave it alone. But if you write: AT&T Markdown will translate it to: AT&T Similarly, because Markdown supports inline HTML if you use angle brackets as delimiters for HTML tags, Markdown will treat them as such. But if you write: 4 < 5 Markdown will translate it to: 4 < 5 However, inside Markdown code spans and blocks, angle brackets and ampersands are always encoded automatically. This makes it easy to use Markdown to write about HTML code. (As opposed to raw HTML, which is a terrible format for writing about HTML syntax, because every single < and & in your example code needs to be escaped.) BLOCK ELEMENTS Paragraphs and Line Breaks A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines. (A blank line is any line that looks like a blank line -- a line containing nothing but spaces or tabs is consid‐ ered blank.) Normal paragraphs should not be indented with spaces or tabs. The implication of the "one or more consecutive lines of text" rule is that Markdown supports "hard-wrapped" text paragraphs. This differs significantly from most other text-to-HTML formatters (including Mov‐ able Type's "Convert Line Breaks" option) which translate every line break character in a paragraph into a 
tag. When you do want to insert a 
break tag using Markdown, you end a line with two or more spaces, then type return. Yes, this takes a tad more effort to create a 
, but a simplistic "every line break is a 
" rule wouldn't work for Markdown. Markdown's email-style blockquoting and multi-paragraph list items work best -- and look better -- when you format them with hard breaks. Headers Markdown supports two styles of headers, [Setext] ]8;;http://docutils.sourceforge.net/mirror/setext.html\1]8;;\ and [atx] ]8;;http://www.aaronsw.com/2002/atx/\2]8;;\. Setext-style headers are "underlined" using equal signs (for first-level headers) and dashes (for second-level headers). For example: This is an H1 ============= This is an H2 ------------- Any number of underlining ='s or -'s will work. Atx-style headers use 1-6 hash characters at the start of the line, corresponding to header levels 1-6. For example: # This is an H1 ## This is an H2 ###### This is an H6 Optionally, you may "close" atx-style headers. This is purely cosmetic -- you can use this if you think it looks better. The closing hashes don't even need to match the number of hashes used to open the header. (The number of opening hashes determines the header level.) : # This is an H1 # ## This is an H2 ## ### This is an H3 ###### Blockquotes Markdown uses email-style > characters for blockquoting. If you're familiar with quoting passages of text in an email message, then you know how to create a blockquote in Markdown. It looks best if you hard wrap the text and put a > before every line: > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. > > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse > id sem consectetuer libero luctus adipiscing. Markdown allows you to be lazy and only put the > before the first line of a hard-wrapped paragraph: > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing. Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by adding additional levels of >: > This is the first level of quoting. > > > This is nested blockquote. > > Back to the first level. Blockquotes can contain other Markdown elements, including headers, lists, and code blocks: > ## This is a header. > > 1. This is the first list item. > 2. This is the second list item. > > Here's some example code: > > return shell_exec("echo $input | $markdown_script"); Any decent text editor should make email-style quoting easy. For example, with BBEdit, you can make a selection and choose Increase Quote Level from the Text menu. Lists Markdown supports ordered (numbered) and unordered (bulleted) lists. Unordered lists use asterisks, pluses, and hyphens -- interchangably -- as list markers: * Red * Green * Blue is equivalent to: + Red + Green + Blue and: - Red - Green - Blue Ordered lists use numbers followed by periods: 1. Bird 2. McHale 3. Parish It's important to note that the actual numbers you use to mark the list have no effect on the HTML output Markdown produces. The HTML Markdown produces from the above list is:
  1. Bird
  2. McHale
  3. Parish
If you instead wrote the list in Markdown like this: 1. Bird 1. McHale 1. Parish or even: 3. Bird 1. McHale 8. Parish you'd get the exact same HTML output. The point is, if you want to, you can use ordinal numbers in your ordered Markdown lists, so that the numbers in your source match the numbers in your published HTML. But if you want to be lazy, you don't have to. If you do use lazy list numbering, however, you should still start the list with the number 1. At some point in the future, Markdown may sup‐ port starting ordered lists at an arbitrary number. List markers typically start at the left margin, but may be indented by up to three spaces. List markers must be followed by one or more spaces or a tab. To make lists look nice, you can wrap items with hanging indents: * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing. But if you want to be lazy, you don't have to: * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing. If list items are separated by blank lines, Markdown will wrap the items in 

tags in the HTML output. For example, this input: * Bird * Magic will turn into:

  • Bird
  • Magic
But this: * Bird * Magic will turn into:
  • Bird

  • Magic

List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be indented by either 4 spaces or one tab: 1. This is a list item with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. Donec sit amet nisl. Aliquam semper ipsum sit amet velit. 2. Suspendisse id sem consectetuer libero luctus adipiscing. It looks nice if you indent every line of the subsequent paragraphs, but here again, Markdown will allow you to be lazy: * This is a list item with two paragraphs. This is the second paragraph in the list item. You're only required to indent the first line. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. * Another item in the same list. To put a blockquote within a list item, the blockquote's > delimiters need to be indented: * A list item with a blockquote: > This is a blockquote > inside a list item. To put a code block within a list item, the code block needs to be indented twice -- 8 spaces or two tabs: * A list item with a code block: It's worth noting that it's possible to trigger an ordered list by accident, by writing something like this: 1986. What a great season. In other words, a number-period-space sequence at the beginning of a line. To avoid this, you can backslash-escape the period: 1986\. What a great season. Code Blocks Pre-formatted code blocks are used for writing about programming or markup source code. Rather than forming normal paragraphs, the lines of a code block are interpreted literally. Markdown wraps a code block in both 
 and  tags.

       To produce a code block in Markdown, simply indent every line of the
       block by at least 4 spaces or 1 tab. For example, given this input:
         This is a normal paragraph:

             This is a code block.

       Markdown will generate:
         

This is a normal paragraph:

This is a code block.
         
One level of indentation -- 4 spaces or 1 tab -- is removed from each line of the code block. For example, this: Here is an example of AppleScript: tell application "Foo" beep end tell will turn into:

Here is an example of AppleScript:

tell application "Foo"
             beep
         end tell
         
A code block continues until it reaches a line that is not indented (or the end of the article). Within a code block, ampersands (&) and angle brackets (< and >) are automatically converted into HTML entities. This makes it very easy to include example HTML source code using Markdown -- just paste it and indent it, and Markdown will handle the hassle of encoding the ampersands and angle brackets. For example, this: will turn into:
<div class="footer">
             &copy; 2004 Foo Corporation
         </div>
         
Regular Markdown syntax is not processed within code blocks. E.g., asterisks are just literal asterisks within a code block. This means it's also easy to use Markdown to write about Markdown's own syntax. Horizontal Rules You can produce a horizontal rule tag (
) by placing three or more hyphens, asterisks, or underscores on a line by themselves. If you wish, you may use spaces between the hyphens or asterisks. Each of the following lines will produce a horizontal rule: * * * *** ***** - - - --------------------------------------- SPAN ELEMENTS Links Markdown supports two style of links: inline and reference. In both styles, the link text is delimited by [square brackets]. To create an inline link, use a set of regular parentheses immediately after the link text's closing square bracket. Inside the parentheses, put the URL where you want the link to point, along with an optional title for the link, surrounded in quotes. For example: This is [an example](http://example.com/ "Title") inline link. [This link](http://example.net/) has no title attribute. Will produce:

This is an example inline link.

This link has no title attribute.

If you're referring to a local resource on the same server, you can use relative paths: See my [About](/about/) page for details. Reference-style links use a second set of square brackets, inside which you place a label of your choosing to identify the link: This is [an example][id] reference-style link. You can optionally use a space to separate the sets of brackets: This is [an example] [id] reference-style link. Then, anywhere in the document, you define your link label like this, on a line by itself: [id]: http://example.com/ "Optional Title Here" That is: • Square brackets containing the link identifier (optionally indented from the left margin using up to three spaces); • followed by a colon; • followed by one or more spaces (or tabs); • followed by the URL for the link; • optionally followed by a title attribute for the link, enclosed in double or single quotes, or enclosed in parentheses. The following three link definitions are equivalent: [foo]: http://example.com/ "Optional Title Here" [foo]: http://example.com/ 'Optional Title Here' [foo]: http://example.com/ (Optional Title Here) Note: There is a known bug in Markdown.pl 1.0.1 which prevents single quotes from being used to delimit link titles. The link URL may, optionally, be surrounded by angle brackets: [id]: "Optional Title Here" You can put the title attribute on the next line and use extra spaces or tabs for padding, which tends to look better with longer URLs: [id]: http://example.com/longish/path/to/resource/here "Optional Title Here" Link definitions are only used for creating links during Markdown processing, and are stripped from your document in the HTML output. Link definition names may consist of letters, numbers, spaces, and punctuation -- but they are not case sensitive. E.g. these two links: [link text][a] [link text][A] are equivalent. The implicit link name shortcut allows you to omit the name of the link, in which case the link text itself is used as the name. Just use an empty set of square brackets -- e.g., to link the word "Google" to the google.com web site, you could simply write: [Google][] And then define the link: [Google]: http://google.com/ Because link names may contain spaces, this shortcut even works for multiple words in the link text: Visit [Daring Fireball][] for more information. And then define the link: [Daring Fireball]: http://daringfireball.net/ Link definitions can be placed anywhere in your Markdown document. I tend to put them immediately after each paragraph in which they're used, but if you want, you can put them all at the end of your document, sort of like footnotes. Here's an example of reference links in action: I get 10 times more traffic from [Google] [1] than from [Yahoo] [2] or [MSN] [3]. [1]: http://google.com/ "Google" [2]: http://search.yahoo.com/ "Yahoo Search" [3]: http://search.msn.com/ "MSN Search" Using the implicit link name shortcut, you could instead write: I get 10 times more traffic from [Google][] than from [Yahoo][] or [MSN][]. [google]: http://google.com/ "Google" [yahoo]: http://search.yahoo.com/ "Yahoo Search" [msn]: http://search.msn.com/ "MSN Search" Both of the above examples will produce the following HTML output:

I get 10 times more traffic from Google than from Yahoo or MSN.

For comparison, here is the same paragraph written using Markdown's inline link style: I get 10 times more traffic from [Google](http://google.com/ "Google") than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or [MSN](http://search.msn.com/ "MSN Search"). The point of reference-style links is not that they're easier to write. The point is that with reference-style links, your document source is vastly more readable. Compare the above examples: using reference-style links, the paragraph itself is only 81 characters long; with inline-style links, it's 176 characters; and as raw HTML, it's 234 characters. In the raw HTML, there's more markup than there is text. With Markdown's reference-style links, a source document much more closely resembles the final output, as rendered in a browser. By allowing you to move the markup-related metadata out of the paragraph, you can add links without interrupting the narrative flow of your prose. Emphasis Markdown treats asterisks (*) and underscores (_) as indicators of emphasis. Text wrapped with one * or _ will be wrapped with an HTML  tag; double *'s or _'s will be wrapped with an HTML  tag. E.g., this input: *single asterisks* _single underscores_ **double asterisks** __double underscores__ will produce: single asterisks single underscores double asterisks double underscores You can use whichever style you prefer; the lone restriction is that the same character must be used to open and close an emphasis span. Emphasis can be used in the middle of a word: un*frigging*believable But if you surround an * or _ with spaces, it'll be treated as a literal asterisk or underscore. To produce a literal asterisk or underscore at a position where it would otherwise be used as an emphasis delimiter, you can backslash escape it: \*this text is surrounded by literal asterisks\* Code To indicate a span of code, wrap it with backtick quotes (`). Unlike a pre-formatted code block, a code span indicates code within a normal paragraph. For example: Use the `printf()` function. will produce:

Use the printf() function.

To include a literal backtick character within a code span, you can use multiple backticks as the opening and closing delimiters: ``There is a literal backtick (`) here.`` which will produce this:

There is a literal backtick (`) here.

The backtick delimiters surrounding a code span may include spaces -- one after the opening, one before the closing. This allows you to place literal backtick characters at the beginning or end of a code span: A single backtick in a code span: `` ` `` A backtick-delimited string in a code span: `` `foo` `` will produce:

A single backtick in a code span: `

A backtick-delimited string in a code span: `foo`

With a code span, ampersands and angle brackets are encoded as HTML entities automatically, which makes it easy to include example HTML tags. Markdown will turn this: Please don't use any `` tags. into:

Please don't use any <blink> tags.

You can write this: `—` is the decimal-encoded equivalent of `—`. to produce:

&#8212; is the decimal-encoded equivalent of &mdash;.

Images Admittedly, it's fairly difficult to devise a "natural" syntax for placing images into a plain text document format. Markdown uses an image syntax that is intended to resemble the syntax for links, allowing for two styles: inline and reference. Inline image syntax looks like this: ![Alt text](/path/to/img.jpg) ![Alt text](/path/to/img.jpg "Optional title") That is: • An exclamation mark: !; • followed by a set of square brackets, containing the alt attribute text for the image; • followed by a set of parentheses, containing the URL or path to the image, and an optional title attribute enclosed in double or single quotes. Reference-style image syntax looks like this: ![Alt text][id] Where "id" is the name of a defined image reference. Image references are defined using syntax identical to link references: [id]: url/to/image "Optional title attribute" As of this writing, Markdown has no syntax for specifying the dimensions of an image; if this is important to you, you can simply use regular HTML  tags. MISCELLANEOUS Automatic Links Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this: Markdown will turn this into: http://example.com/ Automatic links for email addresses work similarly, except that Markdown will also perform a bit of randomized decimal and hex entity-encoding to help obscure your address from address-harvesting spambots. For example, Markdown will turn this: into something like this: address@exa mple.com which will render in a browser as a clickable link to "address@exam‐ ple.com. (This sort of entity-encoding trick will indeed fool many, if not most, address-harvesting bots, but it definitely won't fool all of them. It's better than nothing, but an address published in this way will probably eventually start receiving spam.) Backslash Escapes Markdown allows you to use backslash escapes to generate literal characters which would otherwise have special meaning in Markdown's formatting syntax. For example, if you wanted to surround a word with literal asterisks (instead of an HTML  tag), you can use backslashes before the asterisks, like this: \*literal asterisks\* Markdown provides backslash escapes for the following characters: \ backslash ` backtick * asterisk _ underscore {} curly braces [] square brackets () parentheses # hash mark + plus sign - minus sign (hyphen) . dot ! exclamation mark AUTHOR Markdown was created by John Gruber. Manual page by Ryan Tomayko. It's pretty much a direct copy of the ]8;;http://daringfireball.net/projects/markdown/syntax\Markdown Syntax Reference]8;;\, also by John Gruber. SEE ALSO ronn(5) ]8;;http://daringfireball.net/projects/markdown/\Markdown Syntax Reference]8;;\ January 1979 MARKDOWN(5) marked-man-1.3.5/test/out/nested_list_with_code.out000066400000000000000000000013571453653230300224270ustar00rootroot00000000000000A(1) General Commands Manual A(1) NAME a Tight list: • toggle_status • Toggle the display of the status bar1 • Toggle the display of the status bar2 • spawn TODO explain path-alike expan‐ sion Loose list: • toggle_status • Toggle the display of the status bar1 • Toggle the display of the status bar2 • spawn TODO explain path-alike expan‐ sion January 1979 A(1) marked-man-1.3.5/test/out/noname.out000066400000000000000000000004121453653230300173310ustar00rootroot00000000000000TEST(1) General Commands Manual TEST(1) NAME test - a nice test SYNOPSYS test is a test January 1979 TEST(1) marked-man-1.3.5/test/out/pre_block_with_quotes.out000066400000000000000000000004021453653230300224460ustar00rootroot00000000000000T(1) General Commands Manual T(1) NAME t - test test [ "$11" ] January 1979 T(1) marked-man-1.3.5/test/out/regressions.out000066400000000000000000000005671453653230300204320ustar00rootroot00000000000000REGRESSIONS(7) Miscellaneous Information Manual REGRESSIONS(7) NAME regressions - issues inlines This should be (a b) ok. This should not double escape pkg-js-tools. January 1979 REGRESSIONS(7) marked-man-1.3.5/test/out/simple_table.out000066400000000000000000000022541453653230300205220ustar00rootroot00000000000000SIMPLE_TABLE(1) General Commands Manual SIMPLE_TABLE(1) NAME simple_table ┌──────────────────────────────────────────────────────────┐ │ Col1 Col2 Col3 │ ├──────────────────────────────────────────────────────────┤ │ A B C │ ├──────────────────────────────────────────────────────────┤ │ D E F │ └──────────────────────────────────────────────────────────┘ January 1979 SIMPLE_TABLE(1) marked-man-1.3.5/test/out/table.out000066400000000000000000000321771453653230300171600ustar00rootroot00000000000000TABLE(7) Miscellaneous Information Manual TABLE(7) NAME table - test data for table format test table copy and paste form www. LARGE TABLE ]8;;https://en.wikipedia.org/wiki/Comparison_of_file_systems\Comparison of file systems]8;;\ ┌─────────────────────────────────────────────────────────────────────────┐ │ File system Creator Year of intro‐ Original operat‐ │ │ duction ing system │ ├─────────────────────────────────────────────────────────────────────────┤ │ DECtape DEC 1964 PDP-6 Monitor │ ├─────────────────────────────────────────────────────────────────────────┤ │ DASD IBM 1964 OS/360 │ ├─────────────────────────────────────────────────────────────────────────┤ │ Level-D DEC 1968 TOPS-10 │ ├─────────────────────────────────────────────────────────────────────────┤ │ George 2 ICT (later ICL) 1968 George 2 │ ├─────────────────────────────────────────────────────────────────────────┤ │ Version 6 Unix Bell Labs 1972 Version 6 Unix │ │ file system │ │ (V6FS) │ ├─────────────────────────────────────────────────────────────────────────┤ │ RT-11 file sys‐ DEC 1973 RT-11 │ │ tem │ ├─────────────────────────────────────────────────────────────────────────┤ │ Disk Operating GEC 1973 Core Operating │ │ System (GEC DOS) System │ ├─────────────────────────────────────────────────────────────────────────┤ │ CP/M file system Digital Research 1974 CP/M[1] │ │ (Gary Kildall) │ ├─────────────────────────────────────────────────────────────────────────┤ │ ODS-1 DEC 1975 RSX-11 │ ├─────────────────────────────────────────────────────────────────────────┤ │ GEC DOS filing GEC 1977 OS4000 │ │ system extended │ ├─────────────────────────────────────────────────────────────────────────┤ │ FAT (8-bit) Microsoft (Marc 1977 Microsoft Stand‐ │ │ McDonald) for alone Disk BA‐ │ │ NCR SIC-80 (later │ │ Microsoft Stand‐ │ │ alone Disk BA‐ │ │ SIC-86) │ ├─────────────────────────────────────────────────────────────────────────┤ │ DOS 3.x Apple Computer 1978 Apple DOS │ ├─────────────────────────────────────────────────────────────────────────┤ │ Pascal Apple Computer 1978 Apple Pascal │ ├─────────────────────────────────────────────────────────────────────────┤ │ CBM DOS Commodore 1978 Commodore BASIC │ ├─────────────────────────────────────────────────────────────────────────┤ │ Version 7 Unix Bell Labs 1979 Version 7 Unix │ │ file system │ │ (V7FS) │ ├─────────────────────────────────────────────────────────────────────────┤ │ ODS-2 DEC 1979 OpenVMS │ └─────────────────────────────────────────────────────────────────────────┘ LONG TEXT ┌────────────────────────────────────────────────────────────────────┐ │ Person Work Quote │ ├────────────────────────────────────────────────────────────────────┤ │ Sherlock Holmes The Norwood Builder You mentioned your │ │ name as if I should │ │ recognize it, but │ │ beyond the obvious │ │ facts that you are │ │ a bachelor, a so‐ │ │ licitor, a freema‐ │ │ son, and an asth‐ │ │ matic, I know noth‐ │ │ ing whatever about │ │ you. │ └────────────────────────────────────────────────────────────────────┘ THING TABLE ┌──────────────────────────────────────────────┐ │ 1 2 │ ├──────────────────────────────────────────────┤ │ 1 2 │ ├──────────────────────────────────────────────┤ │ 1 2 │ ├──────────────────────────────────────────────┤ │ 1 2 │ ├──────────────────────────────────────────────┤ │ 1 2 │ ├──────────────────────────────────────────────┤ │ 1 2 │ ├──────────────────────────────────────────────┤ │ T{1 2 │ ├──────────────────────────────────────────────┤ │ 1 2 │ ├──────────────────────────────────────────────┤ │ 1 2 │ ├──────────────────────────────────────────────┤ │ 1 2 │ ├──────────────────────────────────────────────┤ │ 1 2 │ ├──────────────────────────────────────────────┤ │ 1 2 │ ├──────────────────────────────────────────────┤ │ 1 2 │ ├──────────────────────────────────────────────┤ │ 1 2 │ ├──────────────────────────────────────────────┤ │ 1 2 │ ├──────────────────────────────────────────────┤ │ 1 2 │ ├──────────────────────────────────────────────┤ │ 1 2 │ ├──────────────────────────────────────────────┤ │ 1 2 │ ├──────────────────────────────────────────────┤ │ 1 2 │ ├──────────────────────────────────────────────┤ │ 1 2 │ └──────────────────────────────────────────────┘ January 1979 TABLE(7) marked-man-1.3.5/test/out/underline_spacing_test.out000066400000000000000000000010261453653230300226060ustar00rootroot00000000000000UNDERLINE_SPACING_TEST(1) General Commands Manual UNDERLINE_SPACING_TEST(1) NAME underline_spacing_test • -S text, search text: Performs a substring search of formula names for text. • -O , other : Does something else. Should space text properly. January 1979 UNDERLINE_SPACING_TEST(1)