Am 24.11.20 um 09:05 schrieb [email protected]:
Am Dienstag, den 24.11.2020, 08:25 +0100 schrieb Andreas Lehmkuehler:
Am 22.11.20 um 21:19 schrieb [email protected]:
Dear Dev team,

in order to provide a base to slowly enhance our documentation I'm
currently working on an addition to our site generator which
already
works in my local repo. This will allow to add code snippets from
our
examples into the generated docs. To use it the following code
needs to
be put into a document where the code shall appear (as an example
I'm
using a reference to the CreateCheckBox.java example for current
trunk.

``` java
{% codesnippet 'interactive/form/CreateCheckBox.java' 'trunk' %}
```

In addition - in order to be able to only put parts of the code
into
the documentation the following comments can be added to the java
code

//DOC-START
...
//DOC-END

The DOC-START/DOC-END pair can be placed multiple times into the
java
code. Everything between these special comment lines will be added
the
other content will be omitted. This will allow us to skip license
header, import statements etc. to concentrate on the important
bits.

This way we have the benefit of testable code but also the ability
to
reuse that in our docs.

WDYT?
I like the idea, thanks for the effort.

Just out of curiosity, how does the process work? Do those pages
include the
code snippets dynamically or are the pages still static, so that we
have to
regenerate the website after each change within the relevant code
pieces?

the code snippets are embedded when the site is generated i.e. not
fetched at runtime. Fetching at runtime would be doable of course.
Given that when we do a release the examples don't change anymore for
that release I think the static approach is suitable.
Everything is fine as proposed, I just wanted to know how it works :-)

Andreas

BR
Maruan


Andreas

BR
Maruan





-------------------------------------------------------------------
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to