The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #13877 from Octachron/doc_stdlib_module_check

ocamdoc and manual: underscores are a normal part of identifiers

authored by

Florian Angeletti and committed by
GitHub
8f7c58f8 6f24c5ac

+22 -7
+5
Changes
··· 290 290 - #13764, #13779: add missing "-keywords" flag to ocamldep and ocamlprof 291 291 (Florian Angeletti, report by Prashanth Mundkur, review by Gabriel Scherer) 292 292 293 + - #13877: ocamldoc, add a `-latex-escape-underscore` flag to control the 294 + escaping of `_` underscore in latex references (in order to be able to match 295 + odoc behaviour). 296 + (Florian Angeletti, review by Gabriel Scherer) 297 + 293 298 ### Manual and documentation: 294 299 295 300 - #13694: Fix name for caml_hash_variant in the C interface.
+1
api_docgen/ocamldoc/Makefile
··· 89 89 $(V_OCAMLDOC)$(OCAMLDOC_RUN) -latex -o build/latex/all.tex \ 90 90 -hide Stdlib -lib Stdlib $(DOC_ALL_INCLUDES) \ 91 91 -sepfiles \ 92 + -latex-escape-underscore "false" \ 92 93 -latextitle "1,subsection*" \ 93 94 -latextitle "2,subsubsection*" \ 94 95 -latex-type-prefix "TYP" \
+2 -2
manual/src/cmds/unified-options.etex
··· 643 643 \ifouthtml 644 644 chapter~\ref{c:parsinglib}: 645 645 \ahref{compilerlibref/Ast\_mapper.html}{ \texttt{Ast_mapper} } 646 - \else section~\ref{Ast-underscoremapper}\fi, 646 + \else section~\ref{Ast_mapper}\fi, 647 647 implements the external interface of a preprocessor. 648 648 649 649 \item["-principal"] ··· 702 702 using "compiler-libs" library (see 703 703 \ifouthtml chapter~\ref{c:parsinglib} and 704 704 \ahref{compilerlibref/Compiler\_libs.html}{ \texttt{Compiler_libs} } 705 - \else section~\ref{Compiler-underscorelibs}\fi 705 + \else section~\ref{Compiler_libs}\fi 706 706 ). 707 707 }%nat 708 708
+1 -1
manual/src/library/compilerlibs.etex
··· 1 1 \chapter{The compiler front-end} \label{c:parsinglib}\cutname{parsing.html} 2 - \label{Compiler-underscorelibs} % redirect references to compiler_libs.mld here 2 + \label{Compiler_libs} % redirect references to compiler_libs.mld here 3 3 4 4 This chapter describes the OCaml front-end, which declares the abstract 5 5 syntax tree used by the compiler, provides a way to parse, print
+2 -2
manual/src/library/stdlib-blurb.etex
··· 82 82 \end{tabular} 83 83 \subsubsection*{sss:stdlib-io}{input/output:} 84 84 \begin{tabular}{lll} 85 - "In_channel" & p.~\stdpageref{In-underscorechannel} & input channels \\ 86 - "Out_channel" & p.~\stdpageref{Out-underscorechannel} & output channels \\ 85 + "In_channel" & p.~\stdpageref{In_channel} & input channels \\ 86 + "Out_channel" & p.~\stdpageref{Out_channel} & output channels \\ 87 87 "Format" & p.~\stdpageref{Format} & pretty printing with automatic 88 88 indentation and line breaking \\ 89 89 "Marshal" & p.~\stdpageref{Marshal} & marshaling of data structures \\
+1 -1
manual/tests/check-stdlib-modules
··· 10 10 exitcode=0 11 11 for i in `cat $TMPDIR/stdlib-$$-modules`; do 12 12 case $i in 13 - Stdlib | Camlinternal* | *Labels | Obj | In_channel | Out_channel) continue;; 13 + Stdlib | Camlinternal* | *Labels | Obj ) continue;; 14 14 Std_exit*) continue;; 15 15 esac 16 16 grep -q -e '"'$i'" & p\.~\\stdpageref{'$i'} &' $1/manual/src/library/stdlib-blurb.etex || {
+3
ocamldoc/odoc_args.ml
··· 297 297 Arg.String (fun s -> Odoc_latex.latex_class_prefix := s), M.latex_class_prefix ; 298 298 "-latex-class-type-prefix", 299 299 Arg.String (fun s -> Odoc_latex.latex_class_type_prefix := s), M.latex_class_type_prefix ; 300 + "-latex-escape-underscore", Arg.Bool ((:=) Odoc_latex.latex_escape_underscore), 301 + "escape underscore in references"; 302 + 300 303 "-notoc", Arg.Unit (fun () -> Odoc_global.with_toc := false), M.no_toc ^ 301 304 "\n\n *** texinfo options ***\n"; 302 305
+5 -1
ocamldoc/odoc_latex.ml
··· 47 47 let latex_class_type_prefix = ref Odoc_messages.default_latex_class_type_prefix 48 48 let latex_attribute_prefix = ref Odoc_messages.default_latex_attribute_prefix 49 49 let latex_method_prefix = ref Odoc_messages.default_latex_method_prefix 50 + let latex_escape_underscore = ref true 50 51 51 52 let new_buf () = Buffer.create 1024 52 53 let new_fmt () = ··· 186 187 for i = 0 to len - 1 do 187 188 let (s_no_, s) = 188 189 match name.[i] with 189 - '_' -> ("-underscore", "_") 190 + | '_' -> 191 + if !latex_escape_underscore then 192 + ("-underscore", "_") 193 + else ("_","_") 190 194 | '~' -> ("-tilde", "~") 191 195 | '%' -> ("-percent", "%") 192 196 | '@' -> ("-at", "\"@")
+2
ocamldoc/odoc_latex.mli
··· 41 41 42 42 val latex_method_prefix : string ref 43 43 44 + val latex_escape_underscore: bool ref 45 + 44 46 module Generator : 45 47 sig 46 48 class latex :