ringdocdocumentation for Ring packages

Reference

The functions of ringdoc, made from its source with the reference directive.

Names#

articleOf · cardsTable · cardTables · checkIds · checkTargets · checkTarget · collapseSpace · directiveHtml · docsFolder · dpBuild · dpCheckOutput · dpCheck · dpCopyAssets · dpGet · dpLoadProject · dpPackageFolder · dpPdf · dpRingExe · dpSearchEntries · dpTemplate · dropMarkedLinks · dropPrefixes · funcLine · functionsTable · hasOpenWord · hereFolder · indexHtml · isSelfTestOutput · linkText · metaGet · navPages · openDetails · packageHtml · pageHtml · pageIsHidden · parseFront · pdfCover · plainText · prefixIds · refClassHtml · refComment · referenceHtml · refFuncLine · refId · refIsName · refItems · refParse · refSignature · removeSpanTags · rewriteBody · rewriteLinks · rootFolder · runRing · sidebarHtml · sourceLanguage · statTables · wordAfterKeyword · words

The site#

FunctionDescription
hereFolder()The folder of the project (where docproject.ring is)
docsFolder()The folder of the HTML files
rootFolder()The folder that the paths of the directives are relative to
dpGet(cKey,xDefault)The value of a key of a project list ([ :name = "x", ... ]), or a default
metaGet(aMeta,cKey,cDefault)
parseFront(cText)[the front matter as a list of [key, value], the text after it]
plainText(cText)the text of a part of a page without the markup (for the search)
removeSpanTags(cText)</?span[^>]> removed (the [^>] goes over any < until the first >)
collapseSpace(cText)\s+ turned into one space, and the text stripped
sourceLanguage(cRel)
words(cText)the words of a text (split() of Python: white space separates)
isSelfTestOutput(cText)SELFTEST OK (n checks)
functionsTable(cRel)A table of the functions and class methods of a Ring file with the comment above each one
wordAfterKeyword(cLine,cKeyword,nTabs)^keyword\s+(\w+) with the keyword in any case (the line starts with it): the word, or ""
funcLine(cLine)^(\t?)func\s+(\w+)\s*(.*)$ : [name, the rest, true for a function at the left margin] or []
dropPrefixes(cText)(dn|db|wb|ui|wpf)_ removed: the prefix of the names of the parameters and variables that the library keeps to itself (dn_cResponse is shown as cResponse)
pageIsHidden(aPage)is the page marked hidden (a fourth item with the word hidden)? It is not in the sidebar and the previous/next links
navPages()the pages that the navigation shows
sidebarHtml(cCurrent,cRoot)
pageHtml(cName,cTitle,cLead,cBody,cCurrent,cRoot,lToc,cHeading)
directiveHtml(cCmd)The HTML of a {{directive}} line
dpCheckOutput(cRel,cText)The output of the program cRel is checked: a Ring error in it is a warning, and so is a difference from the file <program>.expected next to the program (the expected output is written as the output shows it: ring demo.ring > demo.ring.expected, with <project> instead of the folder)
runRing(cRel,aArgs)The output of a Ring program of the project: it is kept in the cache folder of the project (--refresh runs the program again)
dpLoadProject(cFile)Load a project file: the file sets the list aDocProject
dpRingExe()The Ring interpreter that runs the programs of the project: :ringexe of the project, the running interpreter, or ring in the bin folder next to ringdoc.exe (a ringdoc made with Ring2EXE is in ring/bin)
dpPackageFolder()The folder of the files of the package: its templates and assets (cRingDocHome is set by ringdoclib.ring, which loads this file)
dpTemplate()The template of the pages: the one of the project, or the one of the package
dpCopyAssets()The files of the site that are the same for every project (style and script): copied to the output folder, unless the project has files of its own
dpBuild(cProjectFile,lRefresh)Build the site of a project file. Returns [the number of pages, the number of search entries]
dpSearchEntries(cName,cTitle,cBody)The search entries of a page: one for each section (a part that starts with a heading of the second level)

The PDF#

FunctionDescription
dpPdf(cProjectFile,lHtmlOnly)Makes <output>/pdf/<name>-documentation.html and .pdf. The site is built first when its pages are missing. Returns the path of the PDF, or "" when there is no browser (the HTML page is still made).
pdfCover(cHere,cName)the cover: the project's cover.svg (the text @NAME@ and @TAGLINE@ are replaced), or a plain one made from the name and the tagline
articleOf(cDocs,cName)the part of a page between <article> and </article>
rewriteBody(cBody,cName,aKnown)ids get the page name in front, links to other pages become links inside the document
prefixIds(cBody,cName)\sid="([^"]+)" -> ' id="p-<page>-\1"'
cardTables(cBody)a list of cards (icon, title, text) is one table in print: the title (a link) and the text in a row
cardsTable(cCards)the table of a list of cards, or "" when a card has no title (the list stays as it is)
statTables(cBody)the row of numbers (a number and its label in a box) is one table in print
linkText(cHref,cName,aKnown)the href of a link in the PDF: a page of the project becomes #p-<page>, an outside address stays, anything else is marked to lose its link
openDetails(cBody)<details ...> -> <details open ...> (when the tag has no open)
hasOpenWord(cTag)is there the word open in the text (\bopen\b)?

The reference of the source#

FunctionDescription
refParse(cText)The items of the source of a file: [kind, name, class, text, comment, from] kind "func": text is the parameters kind "class": text is the name of the parent class ("" when there is none) kind "method": class is the class, text is the parameters kind "attr": class is the class, text is the value
refIsName(cText)is the text a name (letters, digits, _) that starts with a letter or _?
refFuncLine(cLine)[name, parameters] of a line func name params (any indentation), or []
refSignature(cName,cArgs)the text of the parameters as a call: "a, b" becomes "(a, b)"
refItems(cPaths)the items of the files of the directive (the paths are separated by spaces)
refId(cKind,cName,cClass)the id of an entry on the page: class-<name>, fn-<name> or m-<class>-<name>
refComment(cText)a comment as HTML (inline Markdown), or "" when there is none
referenceHtml(cPaths){{reference:files}}
refClassHtml(aClass,aItems)the section of a class: the parent, the comment, the table of attributes and the table of methods
indexHtml(cPaths){{index:files}}
packageHtml(cArgs){{package:path}} or {{package:path files}}: a table made from the package.ring of a RingPM package (aPackageInfo)

The check#

FunctionDescription
dpCheck(cProjectFile)the problems of the built site of a project, as a list of lines (an empty list when all is well); the second item of the result is the number of links checked
checkIds(cText)the ids of a page
checkTargets(cText)the links and the files of a page: [ ["href", value], ["src", value] ]
checkTarget(cKind,cValue,cName,cDocs,aNames,aIds)"" when the link or the file is fine, else the problem
ringdoc - documentation made with ringdoc.