doc/commands: introduce Markdown rendering for commands
authorAlexandre Terrasa <alexandre@moz-code.org>
Thu, 3 May 2018 16:42:03 +0000 (12:42 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Fri, 11 May 2018 14:56:11 +0000 (10:56 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

33 files changed:
src/doc/commands/commands_md.nit [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.nit [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_ancestors.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_call.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_children.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_comment.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_descendants.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_entity.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_features.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_clone.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_contrib_file.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_contrib_file_content.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_contributors.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_desc.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_git.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_issues.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_license.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_license_file.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_license_file_content.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_maintainer.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_lin.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_link.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_main_compile.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_mains.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_man_options.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_man_synopsis.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_mentities.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_new.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_param.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_parents.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_return.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_search.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_md.sav/test_cmd_testing.res [new file with mode: 0644]

diff --git a/src/doc/commands/commands_md.nit b/src/doc/commands/commands_md.nit
new file mode 100644 (file)
index 0000000..77ad14a
--- /dev/null
@@ -0,0 +1,322 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Render commands results as Markdown
+module commands_md
+
+import commands::commands_graph
+import commands::commands_usage
+import commands::commands_ini
+import commands::commands_main
+
+import doc_down
+
+redef class DocCommand
+
+       # Render results as a Markdown string
+       fun to_md: Writable do return "**Not yet implemented**"
+end
+
+redef class CmdMessage
+
+       # Render the message as a HTML string
+       fun to_md: Writable is abstract
+end
+
+redef class CmdError
+       redef fun to_md do return "**Error: {to_s}**"
+end
+
+redef class CmdWarning
+       redef fun to_md do return "**Warning: {to_s}**"
+end
+
+# Model commands
+
+redef class CmdEntity
+       redef fun to_md do
+               var mentity = self.mentity
+               if mentity == null then return ""
+               return "`{mentity.name}`"
+       end
+end
+
+redef class CmdEntities
+       redef fun to_md do
+               var mentities = self.results
+               if mentities == null then return ""
+
+               var tpl = new Template
+               for mentity in mentities do
+                       var mdoc = mentity.mdoc_or_fallback
+                       tpl.add "* `{mentity}`"
+                       if mdoc != null then
+                               tpl.add " - "
+                               tpl.add mdoc.synopsis
+                       end
+                       tpl.add "\n"
+               end
+               return tpl.write_to_string
+       end
+end
+
+redef class CmdComment
+       redef fun to_md do
+               var mentity = self.mentity
+               if mentity == null then return ""
+
+               var mdoc = self.mdoc
+               var tpl = new Template
+               tpl.add "### `{mentity}`"
+               if mdoc != null then
+                       tpl.add " - "
+                       tpl.add mdoc.synopsis
+               end
+               tpl.add "\n"
+               if mdoc != null then
+                       tpl.add mdoc.comment
+               end
+               return tpl.write_to_string
+       end
+end
+
+redef class CmdEntityLink
+       redef fun to_md do
+               var mentity = self.mentity
+               if mentity == null then return ""
+               return "`{mentity}`"
+       end
+end
+
+redef class CmdEntityCode
+       redef fun to_md do
+               var output = render_code(node)
+               if output == null then return ""
+
+               var tpl = new Template
+               tpl.addn "~~~nit"
+               tpl.add output.write_to_string
+               tpl.addn "~~~"
+               return tpl.write_to_string
+       end
+end
+
+redef class CmdAncestors
+       redef fun to_md do return super # FIXME lin
+end
+
+redef class CmdParents
+       redef fun to_md do return super # FIXME lin
+end
+
+redef class CmdChildren
+       redef fun to_md do return super # FIXME lin
+end
+
+redef class CmdDescendants
+       redef fun to_md do return super # FIXME lin
+end
+
+redef class CmdFeatures
+       redef fun to_md do return super # FIXME lin
+end
+
+redef class CmdLinearization
+       redef fun to_md do return super # FIXME lin
+end
+
+# Usage commands
+
+redef class CmdNew
+       redef fun to_md do return super # FIXME lin
+end
+
+redef class CmdCall
+       redef fun to_md do return super # FIXME lin
+end
+
+redef class CmdReturn
+       redef fun to_md do return super # FIXME lin
+end
+
+redef class CmdParam
+       redef fun to_md do return super # FIXME lin
+end
+
+# Graph commands
+
+redef class CmdGraph
+       redef fun to_md do
+               var output = render
+               if output == null then return ""
+               return output.write_to_string
+       end
+end
+
+# Ini commands
+
+redef class CmdIniDescription
+       redef fun to_md do
+               var desc = self.desc
+               if desc == null then return ""
+
+               return desc
+       end
+end
+
+redef class CmdIniGitUrl
+       redef fun to_md do
+               var url = self.url
+               if url == null then return ""
+               return "[{url}]({url})"
+       end
+end
+
+redef class CmdIniCloneCommand
+       redef fun to_md do
+               var command = self.command
+               if command == null then return ""
+
+               var tpl = new Template
+               tpl.addn "~~~sh"
+               tpl.addn command
+               tpl.addn "~~~"
+               return tpl.write_to_string
+       end
+end
+
+redef class CmdIniIssuesUrl
+       redef fun to_md do
+               var url = self.url
+               if url == null then return ""
+               return "[{url}]({url})"
+       end
+end
+
+redef class CmdIniMaintainer
+       redef fun to_md do
+               var name = self.maintainer
+               if name == null then return ""
+               return "**{name}**"
+       end
+end
+
+redef class CmdIniContributors
+       redef fun to_md do
+               var names = self.contributors
+               if names == null or names.is_empty then return ""
+
+               var tpl = new Template
+               for name in names do
+                       tpl.addn "* **{name}**"
+               end
+               return tpl.write_to_string
+       end
+end
+
+redef class CmdIniLicense
+       redef fun to_md do
+               var license = self.license
+               if license == null then return ""
+               return "[{license}](https://opensource.org/licenses/{license})"
+       end
+end
+
+redef class CmdEntityFile
+
+       # URL to the file
+       #
+       # Can be refined in subtools.
+       var file_url: nullable String = file is lazy, writable
+
+       redef fun to_md do
+               var file = self.file
+               if file == null then return ""
+               return "[{file.basename}]({file_url or else ""})"
+       end
+end
+
+redef class CmdEntityFileContent
+       redef fun to_md do
+               var content = self.content
+               if content == null then return ""
+
+               var tpl = new Template
+               tpl.addn "~~~"
+               tpl.add content
+               tpl.addn "~~~"
+               return tpl.write_to_string
+       end
+end
+
+# Main commands
+
+redef class CmdMains
+       redef fun to_md do return super # FIXME lin
+end
+
+redef class CmdMainCompile
+       redef fun to_md do
+               var command = self.command
+               if command == null then return ""
+
+               var tpl = new Template
+               tpl.addn "~~~sh"
+               tpl.addn command
+               tpl.addn "~~~"
+               return tpl.write_to_string
+       end
+end
+
+redef class CmdManSynopsis
+       redef fun to_md do
+               var synopsis = self.synopsis
+               if synopsis == null then return ""
+
+               var tpl = new Template
+               tpl.addn "~~~"
+               tpl.addn synopsis
+               tpl.addn "~~~"
+               return tpl.write_to_string
+       end
+end
+
+redef class CmdManOptions
+       redef fun to_md do
+               var options = self.options
+               if options == null or options.is_empty then return ""
+
+               var tpl = new Template
+               tpl.addn "~~~"
+               for opt, desc in options do
+                       tpl.addn "* {opt}\t\t{desc}"
+               end
+               tpl.addn "~~~"
+
+               return tpl.write_to_string
+       end
+end
+
+redef class CmdTesting
+       redef fun to_md do
+               var command = self.command
+               if command == null then return ""
+
+               var tpl = new Template
+               tpl.addn "~~~sh"
+               tpl.addn command
+               tpl.addn "~~~"
+               return tpl.write_to_string
+       end
+end
diff --git a/src/doc/commands/tests/test_commands_md.nit b/src/doc/commands/tests/test_commands_md.nit
new file mode 100644 (file)
index 0000000..ab8eecd
--- /dev/null
@@ -0,0 +1,254 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+module test_commands_md is test
+
+import test_commands
+intrude import doc::commands::commands_main
+import doc::commands::commands_md
+
+class TestCommandsHtml
+       super TestCommands
+       test
+
+       fun print_md(md: nullable Writable) do
+               if md == null then return
+               printn md
+       end
+
+       # CmdEntity
+
+       fun test_cmd_entity is test do
+               var cmd = new CmdEntity(test_view, mentity_name = "test_prog::Character")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       fun test_cmd_comment is test do
+               var cmd = new CmdComment(test_view, mentity_name = "test_prog::Character")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       fun test_cmd_link is test do
+               var cmd = new CmdEntityLink(test_view, mentity_name = "test_prog::Character")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       # CmdInheritance
+
+       fun test_cmd_parents is test do
+               var cmd = new CmdParents(test_view, mentity_name = "test_prog::Warrior")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       fun test_cmd_ancestors is test do
+               var cmd = new CmdAncestors(test_view, mentity_name = "test_prog::Warrior", parents = false)
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       fun test_cmd_children is test do
+               var cmd = new CmdChildren(test_view, mentity_name = "test_prog::Career")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       fun test_cmd_descendants is test do
+               var cmd = new CmdDescendants(test_view, mentity_name = "test_prog::Career")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       # CmdSearch
+
+       fun test_cmd_search is test do
+               var cmd = new CmdSearch(test_view, query = "Carer", limit = 10)
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       # CmdFeatures
+
+       fun test_cmd_features is test do
+               var cmd = new CmdFeatures(test_view, mentity_name = "test_prog::Career")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       # CmdLinearization
+
+       fun test_cmd_lin is test do
+               var cmd = new CmdLinearization(test_view, mentity_name = "init")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       # CmdModel
+
+       fun test_cmd_mentities is test do
+               var cmd = new CmdModelEntities(test_view, kind = "modules")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       # CmdUsage
+
+       fun test_cmd_new is test do
+               var cmd = new CmdNew(test_view, test_builder, mentity_name = "test_prog::Character")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       fun test_cmd_call is test do
+               var cmd = new CmdCall(test_view, test_builder, mentity_name = "strength_bonus")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       fun test_cmd_return is test do
+               var cmd = new CmdReturn(test_view, mentity_name = "test_prog::Character")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       fun test_cmd_param is test do
+               var cmd = new CmdParam(test_view, mentity_name = "test_prog::Character")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       # CmdIni
+
+       fun test_cmd_ini_desc is test do
+               var cmd = new CmdIniDescription(test_view, mentity_name = "test_prog")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       fun test_cmd_ini_git is test do
+               var cmd = new CmdIniGitUrl(test_view, mentity_name = "test_prog")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       fun test_cmd_ini_clone is test do
+               var cmd = new CmdIniCloneCommand(test_view, mentity_name = "test_prog")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       fun test_cmd_ini_issues is test do
+               var cmd = new CmdIniIssuesUrl(test_view, mentity_name = "test_prog")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       fun test_cmd_ini_maintainer is test do
+               var cmd = new CmdIniMaintainer(test_view, mentity_name = "test_prog")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       fun test_cmd_ini_contributors is test do
+               var cmd = new CmdIniContributors(test_view, mentity_name = "test_prog")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       fun test_cmd_ini_license is test do
+               var cmd = new CmdIniLicense(test_view, mentity_name = "test_prog")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       fun test_cmd_ini_license_file is test do
+               var cmd = new CmdLicenseFile(test_view, mentity_name = "test_prog")
+               cmd.init_command
+               cmd.file = cmd.file.as(not null).basename # for testing path
+               print_md cmd.to_md
+       end
+
+       fun test_cmd_ini_license_file_content is test do
+               var cmd = new CmdLicenseFileContent(test_view, mentity_name = "test_prog")
+               cmd.init_command
+               cmd.file = cmd.file.as(not null).basename # for testing path
+               print_md cmd.to_md
+       end
+
+       fun test_cmd_ini_contrib_file is test do
+               var cmd = new CmdContribFile(test_view, mentity_name = "test_prog")
+               cmd.init_command
+               cmd.file = cmd.file.as(not null).basename # for testing path
+               print_md cmd.to_md
+       end
+
+       fun test_cmd_ini_contrib_file_content is test do
+               var cmd = new CmdContribFileContent(test_view, mentity_name = "test_prog")
+               cmd.init_command
+               cmd.file = cmd.file.as(not null).basename # for testing path
+               print_md cmd.to_md
+       end
+
+       # CmdMain
+
+       fun test_cmd_mains is test do
+               var cmd = new CmdMains(test_view, mentity_name = "test_prog")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       fun test_cmd_main_compile is test do
+               var cmd = new CmdMainCompile(test_view, mentity_name = "test_prog::test_prog")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       fun test_cmd_testing is test do
+               var cmd = new CmdTesting(test_view, mentity_name = "test_prog")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       fun test_cmd_man_synopsis is test do
+               var cmd = new CmdManSynopsis(test_view, mentity_name = "test_prog")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+
+       fun test_cmd_man_options is test do
+               var cmd = new CmdManOptions(test_view, mentity_name = "test_prog")
+               cmd.init_command
+               print_md cmd.to_md
+       end
+end
+
+# Avoid path diff
+redef class CmdMainCompile
+       redef fun test_path(file) do
+               if file == null then return null
+               return file.filename.basename
+       end
+end
+
+# Avoid path diff
+redef class CmdTesting
+       redef fun test_path(mentity) do
+               var file = mentity.location.file
+               if file == null then return null
+               return file.filename.basename
+       end
+end
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_ancestors.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_ancestors.res
new file mode 100644 (file)
index 0000000..795a249
--- /dev/null
@@ -0,0 +1 @@
+* `Object` - Root of everything.
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_call.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_call.res
new file mode 100644 (file)
index 0000000..3ed3eb0
--- /dev/null
@@ -0,0 +1,2 @@
+* `character$Character$init`
+* `character$Character$total_strengh` - The actual strength of the character.
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_children.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_children.res
new file mode 100644 (file)
index 0000000..852e940
--- /dev/null
@@ -0,0 +1,3 @@
+* `Alcoholic` - Alcoholics are good to nothing escept taking punches.
+* `Magician` - Magicians know magic and how to use it.
+* `Warrior` - Warriors are good for fighting.
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_comment.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_comment.res
new file mode 100644 (file)
index 0000000..cd7cede
--- /dev/null
@@ -0,0 +1 @@
+### `Character` - Characters can be played by both the human or the machine.
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_descendants.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_descendants.res
new file mode 100644 (file)
index 0000000..852e940
--- /dev/null
@@ -0,0 +1,3 @@
+* `Alcoholic` - Alcoholics are good to nothing escept taking punches.
+* `Magician` - Magicians know magic and how to use it.
+* `Warrior` - Warriors are good for fighting.
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_entity.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_entity.res
new file mode 100644 (file)
index 0000000..4c73ef5
--- /dev/null
@@ -0,0 +1 @@
+`Character`
\ No newline at end of file
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_features.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_features.res
new file mode 100644 (file)
index 0000000..cfabfc6
--- /dev/null
@@ -0,0 +1,10 @@
+* `_endurance_bonus`
+* `_intelligence_bonus`
+* `_strength_bonus`
+* `endurance_bonus`
+* `endurance_bonus=`
+* `careers$Career$init`
+* `intelligence_bonus`
+* `intelligence_bonus=`
+* `strength_bonus`
+* `strength_bonus=`
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_clone.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_clone.res
new file mode 100644 (file)
index 0000000..5f51d0a
--- /dev/null
@@ -0,0 +1,3 @@
+~~~sh
+git clone https://github.com/nitlang/nit.git
+~~~
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_contrib_file.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_contrib_file.res
new file mode 100644 (file)
index 0000000..1040e7b
--- /dev/null
@@ -0,0 +1 @@
+[CONTRIBUTING.md](CONTRIBUTING.md)
\ No newline at end of file
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_contrib_file_content.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_contrib_file_content.res
new file mode 100644 (file)
index 0000000..8353d85
--- /dev/null
@@ -0,0 +1,7 @@
+~~~
+# Contributing rules
+
+* Be nice
+* Be polite
+* Code well
+~~~
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_contributors.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_contributors.res
new file mode 100644 (file)
index 0000000..c297552
--- /dev/null
@@ -0,0 +1,3 @@
+* **Riri <riri@example.com>**
+* **Fifi (http://www.example.com/~fifi)**
+* **Loulou**
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_desc.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_desc.res
new file mode 100644 (file)
index 0000000..549b2be
--- /dev/null
@@ -0,0 +1 @@
+Dummy program used for testing Nit tools
\ No newline at end of file
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_git.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_git.res
new file mode 100644 (file)
index 0000000..59b69e3
--- /dev/null
@@ -0,0 +1 @@
+[https://github.com/nitlang/nit.git](https://github.com/nitlang/nit.git)
\ No newline at end of file
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_issues.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_issues.res
new file mode 100644 (file)
index 0000000..8f3ba20
--- /dev/null
@@ -0,0 +1 @@
+[https://github.com/nitlang/nit/issues](https://github.com/nitlang/nit/issues)
\ No newline at end of file
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_license.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_license.res
new file mode 100644 (file)
index 0000000..292b4e4
--- /dev/null
@@ -0,0 +1 @@
+[Apache-2.0](https://opensource.org/licenses/Apache-2.0)
\ No newline at end of file
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_license_file.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_license_file.res
new file mode 100644 (file)
index 0000000..34173e0
--- /dev/null
@@ -0,0 +1 @@
+[LICENSE.md](LICENSE.md)
\ No newline at end of file
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_license_file_content.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_license_file_content.res
new file mode 100644 (file)
index 0000000..6dac54b
--- /dev/null
@@ -0,0 +1,5 @@
+~~~
+# My Custom License
+
+This is the license content.
+~~~
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_maintainer.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_ini_maintainer.res
new file mode 100644 (file)
index 0000000..d62c3c8
--- /dev/null
@@ -0,0 +1 @@
+**John Doe <jdoe@example.com> (http://www.example.com/~jdoe), Spider-Man**
\ No newline at end of file
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_lin.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_lin.res
new file mode 100644 (file)
index 0000000..4f36fb0
--- /dev/null
@@ -0,0 +1,10 @@
+* `platform$Object$init`
+* `races$Race$init`
+* `careers$Career$init`
+* `races$Human$init`
+* `races$Elf$init`
+* `careers$Warrior$init`
+* `careers$Magician$init`
+* `careers$Alcoholic$init`
+* `character$Character$init`
+* `races$Dwarf$init`
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_link.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_link.res
new file mode 100644 (file)
index 0000000..4c73ef5
--- /dev/null
@@ -0,0 +1 @@
+`Character`
\ No newline at end of file
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_main_compile.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_main_compile.res
new file mode 100644 (file)
index 0000000..72af879
--- /dev/null
@@ -0,0 +1,3 @@
+~~~sh
+nitc test_prog.nit
+~~~
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_mains.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_mains.res
new file mode 100644 (file)
index 0000000..81e391d
--- /dev/null
@@ -0,0 +1 @@
+* `test_prog` - A test program with a fake model to check model tools.
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_man_options.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_man_options.res
new file mode 100644 (file)
index 0000000..dd77a94
--- /dev/null
@@ -0,0 +1,4 @@
+~~~
+* --opt1               Option 1.
+* --opt2               Option 2.
+~~~
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_man_synopsis.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_man_synopsis.res
new file mode 100644 (file)
index 0000000..c44ee77
--- /dev/null
@@ -0,0 +1,3 @@
+~~~
+test_prog [*options*] ARGS...
+~~~
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_mentities.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_mentities.res
new file mode 100644 (file)
index 0000000..0799b32
--- /dev/null
@@ -0,0 +1,11 @@
+* `careers` - Careers of the game.
+* `character` - Characters are playable entity in the world.
+* `combat` - COmbat interactions between characters.
+* `excluded`
+* `game` - A game abstraction for RPG.
+* `game_examples`
+* `platform` - Declares base types allowed on the platform.
+* `races` - Races of the game.
+* `rpg` - A worlg RPG abstraction.
+* `test_game`
+* `test_prog` - A test program with a fake model to check model tools.
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_new.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_new.res
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_param.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_param.res
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_parents.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_parents.res
new file mode 100644 (file)
index 0000000..695c2ff
--- /dev/null
@@ -0,0 +1 @@
+* `Career` - A `Career` gives a characteristic bonus or malus to the character.
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_return.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_return.res
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_search.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_search.res
new file mode 100644 (file)
index 0000000..577166b
--- /dev/null
@@ -0,0 +1,10 @@
+* `Career` - A `Career` gives a characteristic bonus or malus to the character.
+* `career` - The current `Career` of the character.
+* `game` - Gaming group
+* `game` - A game abstraction for RPG.
+* `races` - Races of the game.
+* `careers` - Careers of the game.
+* `Game` - This is the interface you have to implement to use ure gaming platform.
+* `Race` - Race determines basic characteristics and what the character will be able to do in life.
+* `Starter`
+* `age`
diff --git a/src/doc/commands/tests/test_commands_md.sav/test_cmd_testing.res b/src/doc/commands/tests/test_commands_md.sav/test_cmd_testing.res
new file mode 100644 (file)
index 0000000..be77590
--- /dev/null
@@ -0,0 +1,3 @@
+~~~sh
+nitunit tests
+~~~