From: "Ulrich Müller" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/devmanual:master commit in: appendices/devbook-guide/
Date: Wed, 15 Jan 2020 21:29:59 +0000 (UTC) [thread overview]
Message-ID: <1579123725.d10a853abe03569b235f960693f47960c494fd9b.ulm@gentoo> (raw)
commit: d10a853abe03569b235f960693f47960c494fd9b
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 11 10:10:07 2020 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Wed Jan 15 21:28:45 2020 +0000
URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=d10a853a
devbook-guide: Explain <codesample>.
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
appendices/devbook-guide/text.xml | 69 ++++++++++++++++++++++++++++++++++++---
1 file changed, 65 insertions(+), 4 deletions(-)
diff --git a/appendices/devbook-guide/text.xml b/appendices/devbook-guide/text.xml
index 5ae077b..0f0a3ad 100644
--- a/appendices/devbook-guide/text.xml
+++ b/appendices/devbook-guide/text.xml
@@ -262,10 +262,71 @@ prose more <e>punch</e>!
<title>Code samples and colour-coding</title>
<body>
-<todo>
-Fill this section with the information about the use of
-<codesample/>.
-</todo>
+<p>
+The <c><pre></c> tag does not support any syntax highlighting. When you
+need syntax highlighting, use the <c><codesample></c> tag along with a
+<c>lang</c> attribute <d/> usually you want this to be set to <c>"ebuild"</c>
+to syntax highlight ebuild code snippets. Currently, the following languages
+are supported:
+</p>
+
+<ul>
+ <li>c</li>
+ <li>ebuild</li>
+ <li>make</li>
+ <li>m4</li>
+ <li>sgml</li>
+</ul>
+
+<note>
+Remember that all leading and trailing spaces, and line breaks in
+<c><codesample></c> blocks will appear in the displayed html page.
+</note>
+
+<p>
+Sample <c><codesample lang="c"></c> block:
+</p>
+
+<codesample lang="c">
+#include <stdio.h>
+
+main()
+{
+ /* This is a comment */
+ printf("Hello, world!\n");
+}
+</codesample>
+
+<p>
+You can also specify <c>numbering="lines"</c> to enable line numbering, as in
+the following example:
+</p>
+
+<codesample lang="ebuild" numbering="lines">
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DESCRIPTION="MicroGnuEmacs, a port from the BSDs"
+HOMEPAGE="https://homepage.boetes.org/software/mg/"
+SRC_URI="https://github.com/hboetes/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ppc ~ppc64 sparc x86"
+
+RDEPEND="sys-libs/ncurses:0=
+ >=dev-libs/libbsd-0.7.0"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+src_install() {
+ dobin mg
+ doman mg.1
+ dodoc README tutorial
+}
+</codesample>
</body>
</subsection>
next reply other threads:[~2020-01-15 21:30 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-15 21:29 Ulrich Müller [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-01-15 21:29 [gentoo-commits] proj/devmanual:master commit in: appendices/devbook-guide/ Ulrich Müller
2020-01-15 21:29 Ulrich Müller
2020-01-15 21:29 Ulrich Müller
2020-01-15 21:29 Ulrich Müller
2020-01-15 21:30 Ulrich Müller
2020-01-15 21:30 Ulrich Müller
2020-01-15 22:14 Ulrich Müller
2020-01-15 22:36 Ulrich Müller
2020-01-16 18:50 Ulrich Müller
2020-01-28 5:55 Ulrich Müller
2020-02-22 21:27 Ulrich Müller
2020-03-01 12:32 Ulrich Müller
2020-03-06 16:30 Ulrich Müller
2020-03-06 16:30 Ulrich Müller
2020-08-21 16:53 Ulrich Müller
2020-12-14 19:35 Ulrich Müller
2021-03-11 11:24 Ulrich Müller
2021-03-12 19:32 Ulrich Müller
2021-03-19 19:22 Ulrich Müller
2021-03-19 19:23 Ulrich Müller
2021-03-19 19:23 Ulrich Müller
2021-07-31 17:59 Ulrich Müller
2022-02-16 18:56 Ulrich Müller
2023-10-05 20:29 Ulrich Müller
2023-11-05 16:45 Ulrich Müller
2023-11-05 16:48 Ulrich Müller
2024-05-08 5:57 Ulrich Müller
2024-10-25 11:21 Ulrich Müller
2024-10-31 18:59 Ulrich Müller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1579123725.d10a853abe03569b235f960693f47960c494fd9b.ulm@gentoo \
--to=ulm@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox