Code Monkey home page Code Monkey logo

Comments (10)

LBroe avatar LBroe commented on August 25, 2024 2

@aseaday But the syntax is exactly what's missing. We already have a long and thorough readme with links to further information. We just don't know how to write a program with this programming language.

from markovjunior.

mxgmn avatar mxgmn commented on August 25, 2024 2

I have started writing about xml syntax in syntax.md. Hope this helps!

from markovjunior.

tscales avatar tscales commented on August 25, 2024

The node factory is a good place to start, These will be your toplevel elements.

Node result = xelem.Name.LocalName switch
{
"one" => new OneNode(),
"all" => new AllNode(),
"prl" => new ParallelNode(),
"markov" => new MarkovNode(),
"sequence" => new SequenceNode(),
"path" => new PathNode(),
"map" => new MapNode(),
"convolution" => new ConvolutionNode(),
"convchain" => new ConvChainNode(),
"wfc" when xelem.Get<string>("sample", null) != null => new OverlapNode(),
"wfc" when xelem.Get<string>("tileset", null) != null => new TileNode(),
_ => null
};

Each node has a Load method which should help deduce what nested elements the node is expecting.

from markovjunior.

inkydragon avatar inkydragon commented on August 25, 2024

I'm trying to write xsd definitions for xml files.
It looks like VS can automatically load the xsd and display popups.
Of course it is also important to write human-readable documentation.

Some attempts (remarks may not be accurate):

models.xsd

put this at docs/models.xsd

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="models">
        <xs:complexType mixed="true">
            <xs:sequence>
                <xs:element name="model" maxOccurs="unbounded">
                    <xs:complexType>
                        <xs:attribute name="name" type="xs:string" use="required">
                            <xs:annotation>
                                <xs:documentation>Model xml file name.

File `$"models/{name}.xml"` should exist.
</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="size" default="-1" type="xs:int" use="optional">
                            <xs:annotation>
                                <xs:documentation>Output Size in Pixel. default=-1

Note: If `size` is not specified, then `widht` and `hight` should be specified.</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="d" default="2" use="optional">
                            <xs:annotation>
                                <xs:documentation>Output dimension. [2, 3] default=2</xs:documentation>
                            </xs:annotation>
                            <xs:simpleType>
                                <xs:restriction base="xs:positiveInteger">
                                    <xs:enumeration value="2" />
                                    <xs:enumeration value="3" />
                                </xs:restriction>
                            </xs:simpleType>
                        </xs:attribute>
                        <xs:attribute name="length" type="xs:positiveInteger" use="optional">
                            <xs:annotation>
                                <xs:documentation>X-axis length. default=size</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="width" type="xs:positiveInteger" use="optional">
                            <xs:annotation>
                                <xs:documentation>Y-axis width. default=size</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="height" type="xs:positiveInteger" use="optional">
                            <xs:annotation>
                                <xs:documentation>Z-axis height.

2D (d==2), default=1;
3D (d==3), default=size;
</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="amount" default="2" type="xs:positiveInteger" use="optional">
                            <xs:annotation>
                                <xs:documentation>Number of output files. default=2</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="pixelsize" default="4" type="xs:positiveInteger" use="optional">
                            <xs:annotation>
                                <xs:documentation>Pixel point size. default=4</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="seeds" default="null" type="xs:string" use="optional">
                            <xs:annotation>
                                <xs:documentation>Random number seed list. default=null</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="gif" default="false" type="xs:boolean" use="optional">
                            <xs:annotation>
                                <xs:documentation>Whether to output gifs. default=false</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="iso" default="false" type="xs:boolean" use="optional">
                            <xs:annotation>
                                <xs:documentation>Whether to output in `iso` format. default=false</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="steps" default="1000" type="xs:int" use="optional">
                            <xs:annotation>
                                <xs:documentation>Number of rule execution steps. 

GIF (gif==true), default=1000;
Others (gif==false), default=50000;</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="gui" default="0" type="xs:nonNegativeInteger" use="optional">
                            <xs:annotation>
                                <xs:documentation>The width of the graphical rule sidebar in the output image. 
default=0 (not show)</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

image
image
image
image

from markovjunior.

aseaday avatar aseaday commented on August 25, 2024

Hi, I am working on a port of Markov Junior project. And I am considering to create a doc for this project. What syntax doc format do you prefer or recommend?

from markovjunior.

LBroe avatar LBroe commented on August 25, 2024

@aseaday It's supposed to be a programming language, so we need a description of how to write a program with it. What are the keywords and how does the control flow work? I'd just start with a markdown file, because that is the most accessible format.

from markovjunior.

aseaday avatar aseaday commented on August 25, 2024

from markovjunior.

inkydragon avatar inkydragon commented on August 25, 2024

How about Gitbook.

I would recommend GitHub pages.
We can write some md documentation first and then decide how to deploy it.

from markovjunior.

aseaday avatar aseaday commented on August 25, 2024

How about we talk in Documentation and resources #24.
I think we could formally do this thing as a team.

from markovjunior.

aseaday avatar aseaday commented on August 25, 2024

@aseaday But the syntax is exactly what's missing. We already have a long and thorough readme with links to further information. We just don't know how to write a program with this programming language.

I got you. The explanation of node type and there combination rule is missing.

from markovjunior.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.