Skip to main content

module lang::rascal::tutor::conversions::ADtoMD

rascal-0.40.13-BOOT2
rascal-tutor-0.19.9

Temporary utility conversions for evolving the tutor syntax from AsciiDoc to Docusaurus Markdown

Usage

import lang::rascal::tutor::conversions::ADtoMD;

Dependencies

import util::FileSystem;
import IO;
import String;

function ad2md

void ad2md(loc root)

function isSourceFile

bool isSourceFile(loc f)

function convertFile

void convertFile(loc file)

function convertLine

str convertLine(/<prefix:.*>link:\/<course:[A-Za-z0-9]+>#<concept:[A-Za-z0-9\-]+>\[<title:[^\]]*>\]<postfix:.*$>/)

str convertLine(/<prefix:.*>link:\/<course:[A-Za-z0-9]+>\[<title:[^\]]*>\]<postfix:.*$>/)

str convertLine(/<prefix:.*>\<\<<concept:[A-Za-z0-9\-]+>\>\><postfix:.*$>/)

str convertLine(/^<prefix:.*>image:[:]*<filename:[A-Za-z\-0-9]+>\.<ext:png|jpeg|jpg|svg>\[<properties:[^\]]*>\]<postfix:.*$>/)

str convertLine(/^<prefix:.*>\<\<<concept:[A-Za-z\-0-9\ ]+>,<title:[A-Za-z\-0-9\ ]+>\>\><postfix:.*$>/)

str convertLine(/^<prefix:.*>\<\<<concept:[A-Za-z\-0-9\ ]+>\>\><postfix:.*$>/)

str convertLine(/^<prefix:.*>loctoc::\[[0-9]+\]<postfix:.*$>/)

str convertLine(/^<prefix:.*>kbd:\[<keys:.*?>\]<postfix:.*$>/)

str convertLine(/^\ \ \ \ \*\*<postfix:.*$>/)

str convertLine(/^<prefix:.*>\(\(Libraries:<postfix:.*$>/)

str convertLine(/^<prefix:.*>\(\(Library:Libraries-<postfix:.*$>/)

str convertLine(/^<prefix:.*>\(\(Library:Prelude-<postfix:.*$>/)

str convertLine(/^<prefix:.*>\(\(<pre:[^\)]+>-Prelude-<lst:[^\)\-]+>\)\)<postfix:.*>$/)

str convertLine(/^<prefix:.*>\(\(<pre:[^\)]+>-<fst:[^\)\-]+>-<lst:[^\)\-]+>\)\)<postfix:.*>$/)

str convertLine(/^<prefix:.*>\(\(Rascal:Concepts-<rest:[^)]+>\)\)<postfix:.*>$/)

str convertLine(/^<prefix:.*>`<prequote:[^`]*>_<italics:[A-Za-z0-9~]+>_<postquote:[^`]*>`<postfix:.*$>/)

str convertLine(/^<prefix:.*>http\:\/\/<url:[^\[\(\)]+>\[<label:[^\]\(\)]+>\]<postfix:.*$>/)

str convertLine(/^keywords: \"<stuff:.*>\"\s*$/)

str convertLine(/^details: <stuff:.*>\s*$/)

str convertLine(/^title: \"<stuff:.*>\"\s*$/)

str convertLine(/^\ \ \-\ \"\"<thing:[^A-Za-z0-9\-\_\ \t\"]+>\"\"\s*$/)

str convertLine(/^\ \ \-\ true\s*$/)

str convertLine(/^\ \ \-\ false\s*$/)

default str convertLine(str line)

function extractTitle

str extractTitle(/title=\"<t:[^\"]+>\"/)

default str extractTitle(str x)