2020-12-29 00:39:12 +01:00
|
|
|
#+TITLE: Top-level
|
2021-01-01 17:05:25 +01:00
|
|
|
#+SETUPFILE: ../docs/org-html-themes/org/theme-readtheorg.setup
|
2020-12-29 00:39:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
#+name: synopsis
|
|
|
|
#+begin_src ocaml :export output raw
|
|
|
|
"Installs pretty printers for top-level."
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+RESULTS: synopsis
|
|
|
|
: Installs pretty printers for top-level.
|
|
|
|
|
|
|
|
|
|
|
|
* Dune files :noexport:
|
|
|
|
|
|
|
|
** Generate dune files
|
|
|
|
|
|
|
|
Use [C-c C-c] on the code below to create the output for the dune files
|
|
|
|
|
|
|
|
#+header: :noweb strip-export
|
|
|
|
#+header: :var name=(file-name-directory buffer-file-name)
|
|
|
|
#+begin_src python :exports none :results output none
|
|
|
|
name = name.split('/')[-2]
|
|
|
|
synopsis = """
|
|
|
|
<<synopsis>>
|
|
|
|
"""
|
|
|
|
|
2021-01-01 17:05:25 +01:00
|
|
|
with open("lib/dune",'w') as f:
|
2020-12-29 00:39:12 +01:00
|
|
|
f.write(f"""
|
|
|
|
(library
|
|
|
|
(name {name})
|
|
|
|
(public_name qcaml.{name})
|
|
|
|
(synopsis {synopsis} )
|
|
|
|
(modes byte)
|
|
|
|
(libraries
|
|
|
|
compiler-libs.toplevel
|
|
|
|
qcaml
|
|
|
|
)
|
|
|
|
)
|
|
|
|
""")
|
|
|
|
#+end_src
|