Markdown Monster
Looking for suggestions of an editor to document a product API
Gravatar is a globally recognized avatar based on your email address. Looking for suggestions of an editor to document a product API
  Alejandro A Sosa
  All
  Apr 11, 2019 @ 04:00pm

Hi,

I'm looking for an editor to document the API of a product we use in a collapsible tree with text and code here and there.

I haven't been able to make that work in Markdown Monster, OneNote or Word.

Does anyone have suggestions? Perhaps a VSCode extension?

TIA,

Alex

Something like this:
+ 1. Product title
  + 1.1 Admin API
    Several lines of explanation that collapses  when + sign above is clicked
    + 1.1.1 Case 1
      * Code sample that collapses when the + sign above is clicked
      FOR i = 1 TO 10
          IF Condition
              DO XXX
          ELSE
             DO That
          ENDIF
      ENDFOR
    + 1.1.2 Case 2
      More stuff that collapses
  + 2. Sales API
    More stuff that collapses when + sign is clicked

etc

Gravatar is a globally recognized avatar based on your email address. re: Looking for suggestions of an editor to document a product API
  Rick Strahl
  Alejandro A Sosa
  Apr 11, 2019 @ 09:40pm

What you're asking for is not really a document editing feature but a rendering feature.

You can do this in Markdown Monster by adding a little script to either your page or better your template.

For example doing something like this:

* askdjlaksjdasd
* asdalskdjlaksdjasd
    * casdkljasdlk
    * asdaskdjhasd
* asdkalskdjasldk
    * casdkljasdlk
    * asdaskdjhasd
    * casdkljasdlk
    * asdaskdjhasd
* One More


<style>
   li { color: steelblue; }
   ul ul>li { display: none; }
</style>

<script src="https://unpkg.com/jquery@3.4.0/dist/jquery.min.js"></script>
<script>
   $("li").click(function() {   
        $(this).find("li").toggle();
   });
</script>

will give you collapsible child items:

You can add the script and styles to the bottom of the active template (Right click on the preview and Edit Template) or you can as I did here simply paste the code into the current document. But you do need to make sure you enable script execution in Edit => Allow Script Execution which is nice for testing and playing around with this.

Now this sort of thing doesn't really scale for documentation and I think you REALLY should not do it that way. You're much better off using a table of contents to break things down into small topics and use the TOC to drive your content and sections.

For that sort of thing Help Builder (or KavaDocs) works really well.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Looking for suggestions of an editor to document a product API
  Alejandro A Sosa
  Rick Strahl
  Apr 12, 2019 @ 07:23am

Perfect answer Rick. Thank you very much

Alex

Gravatar is a globally recognized avatar based on your email address. re: Looking for suggestions of an editor to document a product API
  Alejandro A Sosa
  Rick Strahl
  Apr 15, 2019 @ 11:50am

Hi Rick,

I haven't found "Allow Script Execution" in "Edit" so haven't been able to expand collapsed items. Can you explain please?

Gladly purchased a license for MarkdownMonster. Good product.

Alex

Gravatar is a globally recognized avatar based on your email address. re: Looking for suggestions of an editor to document a product API
  Rick Strahl
  Alejandro A Sosa
  Apr 15, 2019 @ 05:41pm

Ideally though you'll want to add the script code (and possibly the styles) to a custom template. Putting it inline is a bit of work for each topic and it won't render as smoothly as it could.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Looking for suggestions of an editor to document a product API
  Alejandro A Sosa
  Rick Strahl
  Apr 16, 2019 @ 03:29pm

The MarkdownMonster menu I get does not show AllowScriptInMarkdown.

This is what I get.

Gravatar is a globally recognized avatar based on your email address. re: Looking for suggestions of an editor to document a product API
  Rick Strahl
  Alejandro A Sosa
  Apr 16, 2019 @ 03:41pm

That looks like an older version. You probably need to update your version...

In older versions it was on another menu (View perhaps) but you should grab the latest version from the Web site.

https://markdownmonster.west-wind.com/

You may want to uninstall the old version explicitly first - if you had a pretty old version installed, the install locations have changed and perhaps when updating both locations are installed. Easiest is to uninstall completely, then reinstall the new version. Files and settings should preserve across updates.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Looking for suggestions of an editor to document a product API
  Alejandro A Sosa
  Rick Strahl
  Apr 17, 2019 @ 03:48pm

Thank you very much Rick

Alex

© 1996-2024