doc/api: allow entity url customization
authorAlexandre Terrasa <alexandre@moz-code.org>
Wed, 2 May 2018 22:54:55 +0000 (18:54 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Wed, 2 May 2018 23:03:34 +0000 (19:03 -0400)
Also update tests for HTML since the URLs are different.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

13 files changed:
src/doc/api/api_base.nit
src/doc/commands/tests/test_commands_html.sav/test_cmd_ancestors.res
src/doc/commands/tests/test_commands_html.sav/test_cmd_call.res
src/doc/commands/tests/test_commands_html.sav/test_cmd_children.res
src/doc/commands/tests/test_commands_html.sav/test_cmd_comment.res
src/doc/commands/tests/test_commands_html.sav/test_cmd_descendants.res
src/doc/commands/tests/test_commands_html.sav/test_cmd_entity.res
src/doc/commands/tests/test_commands_html.sav/test_cmd_features.res
src/doc/commands/tests/test_commands_html.sav/test_cmd_lin.res
src/doc/commands/tests/test_commands_html.sav/test_cmd_mentities.res
src/doc/commands/tests/test_commands_html.sav/test_cmd_parents.res
src/doc/commands/tests/test_commands_html.sav/test_cmd_search.res
src/doc/templates/templates_html.nit

index e14cf3b..00f48af 100644 (file)
@@ -202,6 +202,8 @@ redef class MEntity
        # URL to `self` within the JSON api.
        fun api_url: String do return "/api/entity/" / full_name
 
+       redef fun html_url do return web_url
+
        redef fun core_serialize_to(v) do
                super
                v.serialize_attribute("web_url", web_url)
index 494edd2..371d4cb 100644 (file)
@@ -1 +1 @@
-<ul><li><a href="class_test_prog_58d_58dObject.html" title="Root of everything.">Object</a> - <span class="synopsys nitdoc">Root of everything.</span></li></ul>
+<ul><li><a href="test_prog_58d_58dObject" title="Root of everything.">Object</a> - <span class="synopsys nitdoc">Root of everything.</span></li></ul>
index bd7e9de..b851952 100644 (file)
@@ -1 +1 @@
-<ul><li><a href="property_test_prog_58d_58dObject_58d_58dinit.html#test_prog_36dCharacter_36dObject_58d_58dinit">init</a></li><li><a href="property_test_prog_58d_58dCharacter_58d_58dtotal_strengh.html#test_prog_36dCharacter_36dtotal_strengh" title="The actual strength of the character.">total_strengh</a> - <span class="synopsys nitdoc">The actual strength of the character.</span></li></ul>
+<ul><li><a href="test_prog_36dCharacter_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dCharacter_36dtotal_strengh" title="The actual strength of the character.">total_strengh</a> - <span class="synopsys nitdoc">The actual strength of the character.</span></li></ul>
index 90bfe86..04cf46a 100644 (file)
@@ -1 +1 @@
-<ul><li><a href="class_test_prog_58d_58dAlcoholic.html" title="Alcoholics are good to nothing escept taking punches.">Alcoholic</a> - <span class="synopsys nitdoc">Alcoholics are good to nothing escept taking punches.</span></li><li><a href="class_test_prog_58d_58dMagician.html" title="Magicians know magic and how to use it.">Magician</a> - <span class="synopsys nitdoc">Magicians know magic and how to use it.</span></li><li><a href="class_test_prog_58d_58dWarrior.html" title="Warriors are good for fighting.">Warrior</a> - <span class="synopsys nitdoc">Warriors are good for fighting.</span></li></ul>
+<ul><li><a href="test_prog_58d_58dAlcoholic" title="Alcoholics are good to nothing escept taking punches.">Alcoholic</a> - <span class="synopsys nitdoc">Alcoholics are good to nothing escept taking punches.</span></li><li><a href="test_prog_58d_58dMagician" title="Magicians know magic and how to use it.">Magician</a> - <span class="synopsys nitdoc">Magicians know magic and how to use it.</span></li><li><a href="test_prog_58d_58dWarrior" title="Warriors are good for fighting.">Warrior</a> - <span class="synopsys nitdoc">Warriors are good for fighting.</span></li></ul>
index af04617..fb53356 100644 (file)
@@ -1 +1 @@
-<h3><a href="class_test_prog_58d_58dCharacter.html" title="Characters can be played by both the human or the machine.">Character</a> - <span class="synopsys nitdoc">Characters can be played by both the human or the machine.</span></h3><div class="nitdoc"></div>
+<h3><a href="test_prog_58d_58dCharacter" title="Characters can be played by both the human or the machine.">Character</a> - <span class="synopsys nitdoc">Characters can be played by both the human or the machine.</span></h3><div class="nitdoc"></div>
index 90bfe86..04cf46a 100644 (file)
@@ -1 +1 @@
-<ul><li><a href="class_test_prog_58d_58dAlcoholic.html" title="Alcoholics are good to nothing escept taking punches.">Alcoholic</a> - <span class="synopsys nitdoc">Alcoholics are good to nothing escept taking punches.</span></li><li><a href="class_test_prog_58d_58dMagician.html" title="Magicians know magic and how to use it.">Magician</a> - <span class="synopsys nitdoc">Magicians know magic and how to use it.</span></li><li><a href="class_test_prog_58d_58dWarrior.html" title="Warriors are good for fighting.">Warrior</a> - <span class="synopsys nitdoc">Warriors are good for fighting.</span></li></ul>
+<ul><li><a href="test_prog_58d_58dAlcoholic" title="Alcoholics are good to nothing escept taking punches.">Alcoholic</a> - <span class="synopsys nitdoc">Alcoholics are good to nothing escept taking punches.</span></li><li><a href="test_prog_58d_58dMagician" title="Magicians know magic and how to use it.">Magician</a> - <span class="synopsys nitdoc">Magicians know magic and how to use it.</span></li><li><a href="test_prog_58d_58dWarrior" title="Warriors are good for fighting.">Warrior</a> - <span class="synopsys nitdoc">Warriors are good for fighting.</span></li></ul>
index 5084eba..4ed025b 100644 (file)
@@ -1 +1 @@
-<a href="class_test_prog_58d_58dCharacter.html" title="Characters can be played by both the human or the machine.">Character</a>
+<a href="test_prog_58d_58dCharacter" title="Characters can be played by both the human or the machine.">Character</a>
index 23f7a6f..8904ee1 100644 (file)
@@ -1 +1 @@
-<ul><li><a href="property_test_prog_58d_58dcareers_58d_58dCareer_58d_58d_endurance_bonus.html">_endurance_bonus</a></li><li><a href="property_test_prog_58d_58dcareers_58d_58dCareer_58d_58d_intelligence_bonus.html">_intelligence_bonus</a></li><li><a href="property_test_prog_58d_58dcareers_58d_58dCareer_58d_58d_strength_bonus.html">_strength_bonus</a></li><li><a href="property_test_prog_58d_58dCareer_58d_58dendurance_bonus.html">endurance_bonus</a></li><li><a href="property_test_prog_58d_58dCareer_58d_58dendurance_bonus_61d.html">endurance_bonus=</a></li><li><a href="property_test_prog_58d_58dObject_58d_58dinit.html#test_prog_36dCareer_36dObject_58d_58dinit">init</a></li><li><a href="property_test_prog_58d_58dCareer_58d_58dintelligence_bonus.html">intelligence_bonus</a></li><li><a href="property_test_prog_58d_58dCareer_58d_58dintelligence_bonus_61d.html">intelligence_bonus=</a></li><li><a href="property_test_prog_58d_58dCareer_58d_58dstrength_bonus.html">strength_bonus</a></li><li><a href="property_test_prog_58d_58dCareer_58d_58dstrength_bonus_61d.html">strength_bonus=</a></li></ul>
+<ul><li><a href="test_prog_58d_58dcareers_58d_58dCareer_58d_58d_endurance_bonus">_endurance_bonus</a></li><li><a href="test_prog_58d_58dcareers_58d_58dCareer_58d_58d_intelligence_bonus">_intelligence_bonus</a></li><li><a href="test_prog_58d_58dcareers_58d_58dCareer_58d_58d_strength_bonus">_strength_bonus</a></li><li><a href="test_prog_58d_58dCareer_58d_58dendurance_bonus">endurance_bonus</a></li><li><a href="test_prog_58d_58dCareer_58d_58dendurance_bonus_61d">endurance_bonus=</a></li><li><a href="test_prog_36dCareer_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_58d_58dCareer_58d_58dintelligence_bonus">intelligence_bonus</a></li><li><a href="test_prog_58d_58dCareer_58d_58dintelligence_bonus_61d">intelligence_bonus=</a></li><li><a href="test_prog_58d_58dCareer_58d_58dstrength_bonus">strength_bonus</a></li><li><a href="test_prog_58d_58dCareer_58d_58dstrength_bonus_61d">strength_bonus=</a></li></ul>
index cb19b6f..3ae2de3 100644 (file)
@@ -1 +1 @@
-<ul><li><a href="property_test_prog_58d_58dObject_58d_58dinit.html#test_prog_36dObject_36dinit">init</a></li><li><a href="property_test_prog_58d_58dObject_58d_58dinit.html#test_prog_36dRace_36dObject_58d_58dinit">init</a></li><li><a href="property_test_prog_58d_58dObject_58d_58dinit.html#test_prog_36dCareer_36dObject_58d_58dinit">init</a></li><li><a href="property_test_prog_58d_58dObject_58d_58dinit.html#test_prog_36dHuman_36dObject_58d_58dinit">init</a></li><li><a href="property_test_prog_58d_58dObject_58d_58dinit.html#test_prog_36dElf_36dObject_58d_58dinit">init</a></li><li><a href="property_test_prog_58d_58dObject_58d_58dinit.html#test_prog_36dWarrior_36dObject_58d_58dinit">init</a></li><li><a href="property_test_prog_58d_58dObject_58d_58dinit.html#test_prog_36dMagician_36dObject_58d_58dinit">init</a></li><li><a href="property_test_prog_58d_58dObject_58d_58dinit.html#test_prog_36dAlcoholic_36dObject_58d_58dinit">init</a></li><li><a href="property_test_prog_58d_58dObject_58d_58dinit.html#test_prog_36dCharacter_36dObject_58d_58dinit">init</a></li><li><a href="property_test_prog_58d_58dObject_58d_58dinit.html#test_prog_36dDwarf_36dObject_58d_58dinit">init</a></li></ul>
+<ul><li><a href="test_prog_36dObject_36dinit">init</a></li><li><a href="test_prog_36dRace_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dCareer_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dHuman_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dElf_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dWarrior_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dMagician_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dAlcoholic_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dCharacter_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dDwarf_36dObject_58d_58dinit">init</a></li></ul>
index f056d4c..91afe93 100644 (file)
@@ -1 +1 @@
-<ul><li><a href="module_test_prog_58d_58dcareers.html" title="Careers of the game.">careers</a> - <span class="synopsys nitdoc">Careers of the game.</span></li><li><a href="module_test_prog_58d_58dcharacter.html" title="Characters are playable entity in the world.">character</a> - <span class="synopsys nitdoc">Characters are playable entity in the world.</span></li><li><a href="module_test_prog_58d_58dcombat.html" title="COmbat interactions between characters.">combat</a> - <span class="synopsys nitdoc">COmbat interactions between characters.</span></li><li><a href="module_excluded_58d_58dexcluded.html">excluded</a></li><li><a href="module_test_prog_58d_58dgame.html" title="A game abstraction for RPG.">game</a> - <span class="synopsys nitdoc">A game abstraction for RPG.</span></li><li><a href="module_test_prog_58d_58dgame_examples.html">game_examples</a></li><li><a href="module_test_prog_58d_58dplatform.html" title="Declares base types allowed on the platform.">platform</a> - <span class="synopsys nitdoc">Declares base types allowed on the platform.</span></li><li><a href="module_test_prog_58d_58draces.html" title="Races of the game.">races</a> - <span class="synopsys nitdoc">Races of the game.</span></li><li><a href="module_test_prog_58d_58drpg.html" title="A worlg RPG abstraction.">rpg</a> - <span class="synopsys nitdoc">A worlg RPG abstraction.</span></li><li><a href="module_test_prog_58d_58dtest_prog.html" title="A test program with a fake model to check model tools.">test_prog</a> - <span class="synopsys nitdoc">A test program with a fake model to check model tools.</span></li></ul>
+<ul><li><a href="test_prog_58d_58dcareers" title="Careers of the game.">careers</a> - <span class="synopsys nitdoc">Careers of the game.</span></li><li><a href="test_prog_58d_58dcharacter" title="Characters are playable entity in the world.">character</a> - <span class="synopsys nitdoc">Characters are playable entity in the world.</span></li><li><a href="test_prog_58d_58dcombat" title="COmbat interactions between characters.">combat</a> - <span class="synopsys nitdoc">COmbat interactions between characters.</span></li><li><a href="excluded_58d_58dexcluded">excluded</a></li><li><a href="test_prog_58d_58dgame" title="A game abstraction for RPG.">game</a> - <span class="synopsys nitdoc">A game abstraction for RPG.</span></li><li><a href="test_prog_58d_58dgame_examples">game_examples</a></li><li><a href="test_prog_58d_58dplatform" title="Declares base types allowed on the platform.">platform</a> - <span class="synopsys nitdoc">Declares base types allowed on the platform.</span></li><li><a href="test_prog_58d_58draces" title="Races of the game.">races</a> - <span class="synopsys nitdoc">Races of the game.</span></li><li><a href="test_prog_58d_58drpg" title="A worlg RPG abstraction.">rpg</a> - <span class="synopsys nitdoc">A worlg RPG abstraction.</span></li><li><a href="test_prog_58d_58dtest_prog" title="A test program with a fake model to check model tools.">test_prog</a> - <span class="synopsys nitdoc">A test program with a fake model to check model tools.</span></li></ul>
index 763ba62..2953e58 100644 (file)
@@ -1 +1 @@
-<ul><li><a href="class_test_prog_58d_58dCareer.html" title="A `Career` gives a characteristic bonus or malus to the character.">Career</a> - <span class="synopsys nitdoc">A <code class="nitcode"><span class="nitcode"><span class="line"><span class="nc_t">Career</span></span></span></code> gives a characteristic bonus or malus to the character.</span></li></ul>
+<ul><li><a href="test_prog_58d_58dCareer" title="A `Career` gives a characteristic bonus or malus to the character.">Career</a> - <span class="synopsys nitdoc">A <code class="nitcode"><span class="nitcode"><span class="line"><span class="nc_t">Career</span></span></span></code> gives a characteristic bonus or malus to the character.</span></li></ul>
index 1a15d91..a6b9ace 100644 (file)
@@ -1 +1 @@
-<ul><li><a href="class_test_prog_58d_58dCareer.html" title="A `Career` gives a characteristic bonus or malus to the character.">Career</a> - <span class="synopsys nitdoc">A <code class="nitcode"><span class="nitcode"><span class="line"><span class="nc_t">Career</span></span></span></code> gives a characteristic bonus or malus to the character.</span></li><li><a href="property_test_prog_58d_58dCharacter_58d_58dcareer.html" title="The current `Career` of the character.">career</a> - <span class="synopsys nitdoc">The current <code class="nitcode"><span class="nitcode"><span class="line"><span class="nc_t">Career</span></span></span></code> of the character.</span></li><li><a href="group_test_prog_62dgame_62d.html" title="Gaming group">game</a> - <span class="synopsys nitdoc">Gaming group</span></li><li><a href="module_test_prog_58d_58dgame.html" title="A game abstraction for RPG.">game</a> - <span class="synopsys nitdoc">A game abstraction for RPG.</span></li><li><a href="module_test_prog_58d_58draces.html" title="Races of the game.">races</a> - <span class="synopsys nitdoc">Races of the game.</span></li><li><a href="module_test_prog_58d_58dcareers.html" title="Careers of the game.">careers</a> - <span class="synopsys nitdoc">Careers of the game.</span></li><li><a href="class_test_prog_58d_58dGame.html" title="This is the interface you have to implement to use ure gaming platform.">Game</a> - <span class="synopsys nitdoc">This is the interface you have to implement to use ure gaming platform.</span></li><li><a href="class_test_prog_58d_58dRace.html" title="Race determines basic characteristics and what the character will be able to do in life.">Race</a> - <span class="synopsys nitdoc">Race determines basic characteristics and what the character will be able to do in life.</span></li><li><a href="class_test_prog_58d_58dStarter.html">Starter</a></li><li><a href="property_test_prog_58d_58dCharacter_58d_58dage.html">age</a></li></ul>
+<ul><li><a href="test_prog_58d_58dCareer" title="A `Career` gives a characteristic bonus or malus to the character.">Career</a> - <span class="synopsys nitdoc">A <code class="nitcode"><span class="nitcode"><span class="line"><span class="nc_t">Career</span></span></span></code> gives a characteristic bonus or malus to the character.</span></li><li><a href="test_prog_58d_58dCharacter_58d_58dcareer" title="The current `Career` of the character.">career</a> - <span class="synopsys nitdoc">The current <code class="nitcode"><span class="nitcode"><span class="line"><span class="nc_t">Career</span></span></span></code> of the character.</span></li><li><a href="test_prog_62dgame_62d" title="Gaming group">game</a> - <span class="synopsys nitdoc">Gaming group</span></li><li><a href="test_prog_58d_58dgame" title="A game abstraction for RPG.">game</a> - <span class="synopsys nitdoc">A game abstraction for RPG.</span></li><li><a href="test_prog_58d_58draces" title="Races of the game.">races</a> - <span class="synopsys nitdoc">Races of the game.</span></li><li><a href="test_prog_58d_58dcareers" title="Careers of the game.">careers</a> - <span class="synopsys nitdoc">Careers of the game.</span></li><li><a href="test_prog_58d_58dGame" title="This is the interface you have to implement to use ure gaming platform.">Game</a> - <span class="synopsys nitdoc">This is the interface you have to implement to use ure gaming platform.</span></li><li><a href="test_prog_58d_58dRace" title="Race determines basic characteristics and what the character will be able to do in life.">Race</a> - <span class="synopsys nitdoc">Race determines basic characteristics and what the character will be able to do in life.</span></li><li><a href="test_prog_58d_58dStarter">Starter</a></li><li><a href="test_prog_58d_58dCharacter_58d_58dage">age</a></li></ul>
index 7a51f06..f74ac84 100644 (file)
@@ -104,14 +104,12 @@ redef class MEntity
 end
 
 redef class MPackage
-       redef fun html_url do return "package_{html_id}.html"
        redef fun html_namespace do return html_link
        redef fun html_icon do return new BSIcon("book", ["text-muted"])
        redef var css_classes = ["public"]
 end
 
 redef class MGroup
-       redef fun html_url do return "group_{html_id}.html"
        redef fun html_icon do return new BSIcon("folder-close", ["text-muted"])
 
        redef fun html_namespace do
@@ -127,7 +125,6 @@ redef class MGroup
 end
 
 redef class MModule
-       redef fun html_url do return "module_{html_id}.html"
        redef fun html_icon do return new BSIcon("file", ["text-muted"])
 
        redef fun html_namespace do
@@ -143,7 +140,6 @@ redef class MModule
 end
 
 redef class MClass
-       redef fun html_url do return "class_{html_id}.html"
        redef fun html_icon do return new BSIcon("stop", css_classes)
        redef fun html_signature(short) do return intro.html_signature(short)
        redef fun css_classes do return super + [visibility.to_s]
@@ -163,7 +159,6 @@ redef class MClass
 end
 
 redef class MClassDef
-       redef fun html_url do return "{mclass.html_url}#{html_id}"
        redef fun css_classes do return super + mclass.css_classes
 
        redef fun html_namespace do
@@ -217,7 +212,6 @@ redef class MClassDef
 end
 
 redef class MProperty
-       redef fun html_url do return "property_{html_id}.html"
        redef fun html_declaration do return intro.html_declaration
        redef fun html_signature(short) do return intro.html_signature(short)
        redef fun html_icon do return new BSIcon("tag", css_classes)
@@ -233,7 +227,6 @@ redef class MProperty
 end
 
 redef class MPropDef
-       redef fun html_url do return "{mproperty.html_url}#{html_id}"
        redef fun css_classes do return super + mproperty.css_classes
 
        redef fun html_namespace do