Author: sveinung
Date: Sun Oct 16 17:33:34 2016
New Revision: 34154

URL: http://svn.gna.org/viewcvs/freeciv?rev=34154&view=rev
Log:
freeciv-manual: add item id.

Add an item id to files that separate items from each other. This makes the
generated help more machine readable.

See patch #7821

Modified:
    trunk/tools/civmanual.c

Modified: trunk/tools/civmanual.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/tools/civmanual.c?rev=34154&r1=34153&r2=34154&view=diff
==============================================================================
--- trunk/tools/civmanual.c     (original)
+++ trunk/tools/civmanual.c     Sun Oct 16 17:33:34 2016
@@ -94,7 +94,7 @@
 #define SECTION_END "</h3>"
 #define IMAGE_BEGIN "<img src=\""
 #define IMAGE_END ".png\">"
-#define ITEM_BEGIN "<div class='item'>\n"
+#define ITEM_BEGIN "<div class='item' id='%s%d'>\n"
 #define ITEM_END "</div>\n"
 #define TAIL "</body></html>"
 #else  /* MANUAL_USE_HTML */
@@ -106,7 +106,7 @@
 #define SECTION_END "==="
 #define IMAGE_BEGIN "[[Image:"
 #define IMAGE_END ".png]]"
-#define ITEM_BEGIN "----\n\n"
+#define ITEM_BEGIN "----\n<!-- %s %d -->\n"
 #define ITEM_END "\n"
 #define TAIL " "
 #endif /* MANUAL_USE_HTML */
@@ -247,7 +247,7 @@
         char buf[256];
         const char *sethelp;
 
-        fprintf(doc, ITEM_BEGIN);
+        fprintf(doc, ITEM_BEGIN, "setting", setting_number(pset));
         fprintf(doc, "%s%s - %s%s\n\n", SECTION_BEGIN, setting_name(pset),
                 _(setting_short_help(pset)), SECTION_END);
         sethelp = _(setting_extra_help(pset, TRUE));
@@ -331,7 +331,7 @@
       for (i = 0; i < CMD_NUM; i++) {
         const struct command *cmd = command_by_number(i);
 
-        fprintf(doc, ITEM_BEGIN);
+        fprintf(doc, ITEM_BEGIN, "cmd", i);
         fprintf(doc, "%s%s  -  %s%s\n\n", SECTION_BEGIN, command_name(cmd),
                 command_short_help(cmd), SECTION_END);
         if (command_synopsis(cmd)) {
@@ -560,7 +560,7 @@
       unit_type_iterate(putype) {
         char buf[64000];
 
-        fprintf(doc, ITEM_BEGIN);
+        fprintf(doc, ITEM_BEGIN, "utype", putype->item_number);
         fprintf(doc, "%s%s%s\n\n", SECTION_BEGIN,
                 utype_name_translation(putype), SECTION_END);
         fprintf(doc,


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to