Skip to content

coqdoc API refactoring#128

Closed
ejgallego wants to merge 7 commits intorocq-prover:v8.5from
ejgallego:coqdoc-jscoq
Closed

coqdoc API refactoring#128
ejgallego wants to merge 7 commits intorocq-prover:v8.5from
ejgallego:coqdoc-jscoq

Conversation

@ejgallego
Copy link
Copy Markdown
Contributor

This pull request introduces a cleanup in coqdoc; backends are mostly untouched, see the log for more details.

Please review.

Tested with Coq documentation, seems to be OK; SF and CPDT seem also OK, that is, they
exhibit the same artifacts in vanilla v8.5 vs the refactored version.

Coqdoc output backend selection is implemented using an `if then else`
construction; thus adding new backends is a bit painful.

Ocaml 3.12 has first class modules which allow to have a more convenient
runtime backend selection.

The patch is relatively straightforward; tested under Ocaml 3.12.1 & 4.03.
Move CoqDoc backends to first class modules.
Refactoring, now the output backend is selected in `main.ml`.
It was a stub and had no effect. Kept a warning in case it has any user
in the wild.
Changes to the backend API, trying to streamline code and make it more
functional.

The commit tries to be conservative wrt existing backend code so lots of
global variables remain in use. More work should be done, but this
commit serves as a checkpoint towards greater refactoring.

Tested with Coq documentation; SF and CPDT seems OK, that is, they
exhibit the same artifacts in vanilla v8.5 vs the refactored version.

The new API additions are documented using ocamldoc.

* New backend specific API functions:

  - appendix: Generates the appendix for a document.
  - start_file / end_file: Starts a file, sets options, generates
    header/footer if needed.

* Operations removed:

  - initialize, header, trailer: replaced by start_file / end_file.
  - make_multi_index, make_index, make_toc: There are options in
    start_file now.

* cdglobals.ml: Add .mli file, add output helper `with_outfile`, make
  a couple of functions private.

* Remove subtitle functionality: Its price in code complexity was too
  high; it also was not very flexible, we will replace it with a more
  flexible mechanism.
Simple backend that logs lexer actions to a .txt file.
@ejgallego ejgallego closed this Jan 19, 2016
@ejgallego ejgallego deleted the coqdoc-jscoq branch January 19, 2016 21:56
@ejgallego ejgallego mentioned this pull request Jan 19, 2016
jfehrle pushed a commit to jfehrle/coq that referenced this pull request Dec 19, 2022
proux01 pushed a commit to proux01/rocq that referenced this pull request Sep 10, 2024
Create a page dedicated to user interfaces.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants