Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix documentation issues #230

Merged
merged 6 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
*/
public interface IConstantCategory {

/** The Constant PREFIX_CONSTANT. */
public static final String PREFIX_CONSTANT = "#";


/** The Constant LENGTH. */
// Units
public static final String LENGTH = "Length units";
Expand Down Expand Up @@ -45,7 +49,7 @@ public interface IConstantCategory {
// Math
public static final String MATH = "Math constants";


/** The Constant COLOR_CSS. */
public static final String COLOR_CSS = "Colors";

}
8 changes: 4 additions & 4 deletions gama.documentation/files/input/pandocPDF/gama_style.sty

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wiki="www.google.fr">
<xsl:variable name="fileSpecies" select="'BuiltInSpecies'" />
<xsl:variable name="fileSkills" select="'BuiltInSkills'" />

<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'" />
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
<xsl:variable name="space" select="' '" />
<xsl:variable name="minus" select="'-'" />


<xsl:template match="/">

Expand Down Expand Up @@ -96,6 +101,8 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wiki="www.google.fr">
<xsl:value-of select="@name" />
<xsl:text>](</xsl:text>
<xsl:value-of select="$fileUnitsConstants" />
<xsl:text>#</xsl:text>
<xsl:value-of select="translate(translate(categories/category/@id, $uppercase, $lowercase), $space, $minus)" />
<xsl:text>)</xsl:text>
<xsl:if test="@altNames">
<xsl:text> (</xsl:text>
Expand Down Expand Up @@ -219,7 +226,7 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wiki="www.google.fr">

## Other concepts
[scheduling](RuntimeConcepts#Scheduling_of_Agents ), [step](RuntimeConcepts#agents-step), [Key concepts](BasicProgrammingConceptsInGAML),
[Object-oriented paradigm to GAML](Introduction#vocabulary-correspondence-with-the-object-oriented-paradigm-as-in-java), [Correspondence GAML and Netlogo](/Introduction#vocabulary-correspondence-with-the-agent-based-paradigm-as-in-netlogo)
[Object-oriented paradigm to GAML](Introduction#vocabulary-correspondence-with-the-object-oriented-paradigm-as-in-java), [Correspondence GAML and Netlogo](Introduction#vocabulary-correspondence-with-the-agent-based-paradigm-as-in-netlogo)


</xsl:template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import java.io.File;

import gama.annotations.precompiler.doc.utils.Constants;
import gama.documentation.transform.XmlToCategoryXML;
import gama.documentation.transform.XmlToWiki;
import gama.documentation.transform.XmlTransform;
import gama.documentation.util.GamaStyleGeneration;
Expand Down Expand Up @@ -50,9 +49,9 @@ public static void main(final String[] args) {
XmlToWiki.createExtentionsWiki();
System.out.println("DONE\n");

System.out.print("Creation of the page for keywords.....");
XmlToCategoryXML.createCategoryWiki();
System.out.println("DONE\n");
// System.out.print("Creation of the page for keywords.....");
// XmlToCategoryXML.createCategoryWiki();
// System.out.println("DONE\n");


System.out.print("GENERATION of the prism highlight JS file.....");
Expand Down
37 changes: 36 additions & 1 deletion gama.documentation/src/gama/documentation/util/UnifyDoc.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
package gama.documentation.util;

import java.io.File;
import java.io.FileOutputStream;
import java.nio.file.Files;
import java.util.HashMap;
import java.util.List;
Expand All @@ -24,6 +23,8 @@
import org.jdom2.output.Format;
import org.jdom2.output.XMLOutputter;

import gama.annotations.precompiler.IConstantCategory;
import gama.annotations.precompiler.constants.ColorCSS;
import gama.annotations.precompiler.doc.utils.Constants;
import gama.annotations.precompiler.doc.utils.TypeConverter;
import gama.annotations.precompiler.doc.utils.XMLElements;
Expand Down Expand Up @@ -148,13 +149,47 @@ private static Document mergeFiles(final HashMap<String, File> hmFilesPackages)
doc.getRootElement().getChild(XMLElements.OPERATORS_CATEGORIES).addContent(new Element(XMLElements.CATEGORY)
.setAttribute(XMLElements.ATT_CAT_ID, new TypeConverter().getProperCategory("Types")));

// Add the colors constant category
doc.getRootElement().getChild(XMLElements.CONSTANTS_CATEGORIES).addContent(new Element(XMLElements.CATEGORY)
.setAttribute(XMLElements.ATT_CAT_ID, IConstantCategory.COLOR_CSS));

// Add the color in constants
Element constantsElt = doc.getRootElement().getChild(XMLElements.CONSTANTS);
final Object[] colorTab = ColorCSS.array;
for (int i = 0; i < colorTab.length; i += 2) {
constantsElt.addContent(createColorConstantElement(colorTab,i));
}

return doc;
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}

private static Element createColorConstantElement(Object[] colorTab, int i) {
final Element constantElt = new Element(XMLElements.CONSTANT);
constantElt.setAttribute(XMLElements.ATT_CST_NAME, IConstantCategory.PREFIX_CONSTANT + colorTab[i]);
constantElt.setAttribute(XMLElements.ATT_CST_VALUE,
"r=" + ((int[]) colorTab[i + 1])[0] + ", g=" + ((int[]) colorTab[i + 1])[1] + ", b="
+ ((int[]) colorTab[i + 1])[2] + ", alpha=" + ((int[]) colorTab[i + 1])[3]);

// Category
final Element categoriesElt = new Element(XMLElements.CATEGORIES);
final Element colorCatElt = new Element(XMLElements.CATEGORY).setAttribute(XMLElements.ATT_CAT_ID, IConstantCategory.COLOR_CSS);
categoriesElt.addContent(colorCatElt);
constantElt.addContent(categoriesElt);

// Concept
final Element conceptsElt = new Element(XMLElements.CONCEPTS);
final Element conceptElt = new Element(XMLElements.CONCEPT).setAttribute(XMLElements.ATT_CAT_ID, IConstantCategory.COLOR_CSS);
conceptsElt.addContent(conceptElt);
constantElt.addContent(conceptsElt);

return constantElt;
}


/**
* The main method.
*
Expand Down
Binary file modified gama.processor/gama.processor.jar
Binary file not shown.
Loading