This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
41
unikernel/duniverse/dune_/doc/howto/bundle.rst
Normal file
41
unikernel/duniverse/dune_/doc/howto/bundle.rst
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
How to Bundle Resources
|
||||
=======================
|
||||
|
||||
This guide will show you how to configure Dune to generate modules with string resources
|
||||
from other files in your project.
|
||||
|
||||
Folder Structure
|
||||
----------------
|
||||
|
||||
.. code:: console
|
||||
|
||||
$ tree src
|
||||
src
|
||||
└── lib
|
||||
└── my_lib
|
||||
├── dune
|
||||
└── resources
|
||||
└── site.css
|
||||
|
||||
Dune Configuration
|
||||
------------------
|
||||
|
||||
See :doc:`/reference/actions/progn` and
|
||||
:doc:`/reference/actions/with-outputs-to`.
|
||||
|
||||
.. code:: dune
|
||||
|
||||
(rule
|
||||
(with-stdout-to
|
||||
css.ml
|
||||
(progn
|
||||
(echo "let css = {|")
|
||||
(cat resources/site.css)
|
||||
(echo "|}"))))
|
||||
|
||||
Using the Bundled Resource
|
||||
--------------------------
|
||||
|
||||
.. code:: ocaml
|
||||
|
||||
let () = Printf.printf "%s" Css.css
|
||||
Loading…
Add table
Add a link
Reference in a new issue