[squeak-dev] Its alive!!!!! DocOrgToHelp that is.

gettimothy gettimothy at zoho.com
Sat Sep 11 12:17:36 UTC 2021


I am looking at a CustomHelp topic with subtopics created on-the-fly against a emacs .org file using a PEGGramamr and the Xtreams-Parsing tools.


totally psyched!


MCHttpRepository

    location: 'http://www.squeaksource.com/Doc'

    user: 'tty'

    password: ''


Stage commit.



I can select a (modifed) TerseGuide.org file  with the Filechooser and parse it and display it directly in the HelpBrowser.



The modification required is standard ORG mode markup.



of



#+BEGIN_EXAMPLE

foo bar biz

#+END_EXAMPLE



I think I will make this standard on output.



There are some bugs (HelpOnHelp ouptut goes into an infinite loop, MetacelloConfigurationHelp bombs out) but a simple working example is:



DocCustomHelpToOrg toFile: SqueakCorePackagesHelp

That creates a SqueakCorePackages.org file which works in Emacs...



To view that file in the HelpBrowser...

DocOrgToCustomHelp fromFileChooser





Now...an immediate change I will be making is to wrap all content in 



#+BEGIN_EXAMPLE



#+END_EXAMPLE









The reason being is that the TerseGuide -> General  Allowable Characters blows up the parser...



Allowable characters:

    - a-z

    - A-Z

    - 0-9

    - .+/\*~<>@%|&?

    - blank, tab, cr, ff, lf





But if I wrap all the content of the TerseGuide in that markup, it works.





So...



next stages are:



Wrap content as noted above.

Write a DocCustomHelp.org manual and import that into the HelpBrowser.

Then, dynamically create the CustomHelp classes ...



At that point, I will have a tool I can use as I study the XML package and write my notes in Org format for later documentation




The grammar looks like this:



grammarORG



"describe very basic Emacs Org-mode .org files



No advanced features or markup of ORg is supported.

https://orgmode.org/manual



2021.09.06 The purpose of this grammar is to take a simple Org file and convert it to CustomHelp format



"





^'

Org                  <- (HeadlineGroup)+



HeadlineGroup <- HeadlineGroup8 / HeadlineGroup7 / HeadlineGroup6 / HeadlineGroup5 / HeadlineGroup4 / HeadlineGroup3 / HeadlineGroup2 / HeadlineGroup1



/* these map to CustomHelpTopic pages */



HeadlineGroup1 <- (HeadlineItem1 HeadlineGroup2* )+

HeadlineGroup2 <- (HeadlineItem2 HeadlineGroup3* )+

HeadlineGroup3 <- (HeadlineItem3 HeadlineGroup4* )+

HeadlineGroup4 <- (HeadlineItem4 HeadlineGroup5* )+

HeadlineGroup5 <- (HeadlineItem5 HeadlineGroup6* )+

HeadlineGroup6 <- (HeadlineItem6 HeadlineGroup7* )+

HeadlineGroup7 <- (HeadlineItem7 HeadlineGroup8* )+

HeadlineGroup8 <- HeadlineItem8+



HeadlineItem1 	<- ^STAR{1} s HeadLineText  Paragraph*

HeadlineItem2 	<- ^STAR{2} s HeadLineText  Paragraph*

HeadlineItem3	<- ^STAR{3} s HeadLineText  Paragraph*

HeadlineItem4	<- ^STAR{4} s HeadLineText  Paragraph*

HeadlineItem5	<- ^STAR{5} s HeadLineText  Paragraph*

HeadlineItem6	<- ^STAR{6} s HeadLineText  Paragraph*

HeadlineItem7	<- ^STAR{7} s HeadLineText  Paragraph*

HeadlineItem8	<- ^STAR{8} s HeadLineText  Paragraph*







/* Headlines */

HeadlineFlow          <- Pagename / Classname 	/ [\s]    /  DotNot

HeadLineText         <- HeadlineFlow{( Pagename / Classname  / !.  )}

Pagename        <- "[" [a-z][a-zA-Z0-9]* "]"

Classname        <- "[" [A-Z][a-zA-Z0-9]* "]"





/* Paragraph */



Paragraph			<- EndOfLine+ ParagraphFlow{(Paragraph /   EndOfLine+ /    !. )}   /* this consumes extra EndOfLines after a paragraph. */

ParagraphFlow		<- 	OrgLiteralExample / [^\*]



/* Org Literal Examples */



OrgLiteralExample	<-   "#+BEGIN_EXAMPLE"  .{"#+END_EXAMPLE"}







/* Primals  (cut-n-paste from elsewhere*/





s					<-	S*                     /* s is zero or more whitespace */

S					<-	whitespace+   /* S is one or more whitespace */

whitespace			<-	[\s\t]

EndOfLine 			<- "\n\r\t" / "\n\t" / "\r\t"  / "\n\r" / "\n" / "\r"                    /* CRLF or CR or LF  (and some with an extra tab, as a hack*/

Identifier			<-	[a-zA-Z0-9_]*

STAR				<-	"*"







/*Unicode ranges allowed. Replaces the "." rule */











DotNot				<-	[\x000020-\X00005A\x00005C\x00005E-\x00007F]





'



"\x000020-\x0000005C\x00005E-\x00007B\x00007D-\x00007F  all of Basic Latin except for

Character value: 16r00005B  [

Character value: 16r00005D  ] 

Character value: 16r00007B  {

Character value: 16r00007C  |

Character value: 16r00007D  }

Character value: 16r00007F   Character delete





DotNot				<-	[\x000000-\x000029\\x00002B-\x00005A\x00005C\x00005E-\x00007A\x00007E\x0000A0-\x0000FF\x000100-\x00017F\x000180-\x00024F\x000300-\x00036F\x000370-\x0003FF\x000400-\x0004FF\x000500-\x00052F\x001E00-\x001EFF\x002000-\x00206F\x002070-\x00209F\x0020A0-\x0020CF\x002150-\x00218F\x002190-\x0021FF\x002200-\x0022FF\x002300-\x0023FF\x002580-\x00259F\x0025A0-\x0025FF\x002600-\x0026FF\x002700-\x0027BF\x0027C0-\x0027EF\x0027F0-\x0027FF\x002900-\x00297F\x002980-\x0029FF\x002A00-\x002AFF\x002B00-\x002BFF ]





"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210911/4c83423f/attachment.html>


More information about the Squeak-dev mailing list