I am reading the source of the R FAQ in texinfo and I think it would be easier to manage and extend it if it were analyzed as a structure of R. There are several existing examples related to this:
state package
bibtex records
Rd files
with some desirable features.
In my opinion, frequently asked questions are not used in the R community because they lack i) easy access from the R command line (that is, through the R package); ii) powerful search functions; iii) cross-references; iv) extensions for introduced packages. Drawing ideas from bibtex and fortunes packages, we could introduce a new system in which:
Frequently asked questions can be found with R. Typical calls will resemble the fortune() interface: faq("lattice print") or faq() #surprise me! , faq(51) , faq(package="ggplot2") .
Packages can provide their own FAQ.rda , the format of which is not yet clear (see below)
Sweave / knitr drivers are provided to output beautifully formatted Markdown / LaTeX, etc.
Question
I am not sure what the best input format is . Either to convert existing frequently asked questions, or to add new entries.
It is cumbersome to use the R syntax with a tree of nested lists (or ad hoc S3 / S4 / ref class or structure ,
\list(title = "Something to be \\escaped", entry = "long text with quotes, links and broken characters", category = c("windows", "mac", "test"))
Rd , even if it is not an R-structure per se (it is rather a subset of LaTeX with its own parser), may perhaps be a more attractive example of an input format. It also has a set of tools for analyzing the structure in R. However, its current goal is quite specific and varied, focusing on general documentation on the functions of R, and not on frequently asked questions of records. Its syntax is also not perfect, I think more modern markup, something like markdowns, will be more readable.
Is there anything else, perhaps examples of parsing markup files in R structures? An example of deviating Rd files from their destination?
To summarize
I would like to come up with:
1 is a good design for an R structure (a class, perhaps) that extends the fortune package to more general entries, such as FAQ items
2- a more convenient format for entering new frequently asked questions (instead of the current texinfo format)
3 - a parser written in R or in some other language (bison?) To convert existing frequently asked questions into a new structure (1) and / or a new input format (2) into an R.
Update 2: in the last two days of the bounty period, I received two answers, both interesting, but completely different. Since the question is quite extensive (possibly incorrect), none of the answers gives a complete solution, so I will not (so far anyway) accept the answer. Regarding generosity, I will explain it by the answer that was voted before the expiration, wishing there was a way to divide it more evenly.