Skip to content

Manual: caml_example for language extensions#939

Merged
gasche merged 7 commits intoocaml:trunkfrom
Octachron:manual_camlexample_for_exten
Nov 29, 2016
Merged

Manual: caml_example for language extensions#939
gasche merged 7 commits intoocaml:trunkfrom
Octachron:manual_camlexample_for_exten

Conversation

@Octachron
Copy link
Copy Markdown
Member

This PR proposes to use the caml_example pseudo-environment in the language extension section of the manual. This section already contains handwritten code example that mimics the output style of the
caml_example pseudo-environment. Moreover, the protection against unexpected errors and warnings in #693 should make safer the use of these environment in this part of the documentation.

The first commit in this PR simply add the possibility to use these environment in exten.etex. The second and third commit convert some examples that were already using handwritten \caml … \endcaml environment and related verbatim environment.

The last commit is (probably) partially unrelated but fixes a missing font-family:monospace style declaration in the generated html − and removes an unneeded hack.

@gasche
Copy link
Copy Markdown
Member

gasche commented Nov 28, 2016

This is very nice, and it's enough work that I think there should be a Change entry. One thing you could do is to merge it with the entry for #693.

@gasche
Copy link
Copy Markdown
Member

gasche commented Nov 28, 2016

(To clarify my thinking a bit, I think some software projects have or give the unfortunate impression that changes to the documentation are of lesser value than changes to the program code. We don't want to do that; in particular, we should not let the people that take some much-needed care of the manual self-censor themselves by downsizing the effort involved.)

\endcaml
polymorphic:
\begin{caml_example}[error]
let id: 'a. 'a -> 'a = fun x -> x
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be keep fun x -> x+1

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! Thanks.

As a side-note, the crucial error here was the missing ;; at the end of the caml_example
that circumvented the status detection for the caml_example. This is fixed in the new version
of the PR.

@Octachron Octachron force-pushed the manual_camlexample_for_exten branch from 7f3c7b7 to a57a5d4 Compare November 29, 2016 18:29
@Octachron
Copy link
Copy Markdown
Member Author

I have added an item to the Changelog in the manual section: I thought it will be better for readability to not group together changes with quite different objects; even if they share a common internal purpose.

I have also added a missing double semi-colon detection logic for caml_example environments.
Otherwise, such error could circumvent the output status check and lead to discarded code phrase.

@gasche
Copy link
Copy Markdown
Member

gasche commented Nov 29, 2016

@lavib if you wanted to be credited as a reviewer in the Changelog, which name would you prefer us to use? (Usually we use real-name-looking names, but some people have other preferences.) Did you review the whole PR, or just randomly peeked and saw this one issue?

@lavib
Copy link
Copy Markdown

lavib commented Nov 29, 2016 via email

@gasche gasche merged commit 4c04dee into ocaml:trunk Nov 29, 2016
@gasche
Copy link
Copy Markdown
Member

gasche commented Nov 29, 2016

Ok, I went ahead and merged then. Thanks for the nice work!

camlspotter pushed a commit to camlspotter/ocaml that referenced this pull request Oct 17, 2017
Manual: caml_example for language extensions
stedolan pushed a commit to stedolan/ocaml that referenced this pull request Mar 21, 2023
IRC: avoid unnecessary round.
EmileTrotignon pushed a commit to EmileTrotignon/ocaml that referenced this pull request Jan 12, 2024
* Adds package autocomplete search to the search dropdown

* factor highlight_search_terms into a component

* add interactive search to packages page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants