Skip to main content

module lang::rascal::tutor::conversions::ConvertSections

rascal-0.40.13-BOOT2
rascal-tutor-0.19.9

Usage

import lang::rascal::tutor::conversions::ConvertSections;

Dependencies

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

function convertAllSections

void convertAllSections(loc dir)

function isConceptFile

bool isConceptFile(loc f)

function isImageFile

bool isImageFile(loc f)

function convertSections

list[str] convertSections(loc file)

list[str] convertSections([str first:/^\s*\[source,rascal<rest1:.*>]\s*$/, /---/, *str block, /----*<postfix:[^\-]*>/, *str rest2])

list[str] convertSections([str first:/^\s*\[source[^\]]*\]\s*$/, /---/, *str block, /----*<postfix:[^\-]*>/, *str rest2])

list[str] convertSections([str first:/^#\s+<title:.*>$/, *str rest2, /^\s*\.Index/, *str indexLines, str nextHeader:/^\s*\.[A-Z][a-z]*/, *str rest3])

list[str] convertSections([str first:/^#\s+<title:.*>$/, *str rest2, str nextHeader:/^\s*\.[A-Z][a-z]*/, *str rest3])

function words

list[str] words(list[str] input)

list[str] words(str input)

function convertSections

list[str] convertSections(["---", *str headers, "---", *str otherStuff, /^\s*\.Details/, *str detailsLines, str nextHeader:/^\s*\.[A-Z][a-z]*/, *str moreStuff])

list[str] convertSections([/^\.<headerTitle:[A-Z][A-Za-z]+>\s*$/, *str otherStuff])

list[str] convertSections([
str before,
/^\s*\|====*\s*$/,
str firstLine,
*str body,
/^\s*\|====*\s*$/,
*str rest
])

function emptyHeader

str emptyHeader(str firstLine)

function completeBodyLine

str completeBodyLine(str body)

function columnsLine

str columnsLine(/\|\s*\|<postfix:.*>$/)

str columnsLine("|")

function convertSections

list[str] convertSections([])

default list[str] convertSections([str first, *str last])

function removeQuotesThing

str removeQuotesThing(/^<prefix:.*>,subs=\"quotes\"<postfix:.*>/)

default str removeQuotesThing(str x)