Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

editing sheet json instructions value (markdown)

March 18 (8 years ago)

Edited March 18 (8 years ago)
vÍnce
Pro
Sheet Author
Just curious how other sheet authors handle editing the "instructions" value in your sheet.json file?  It accepts some form of markdown which should be easy enough.  However it would be nice to use a wysiwyg editor.  Since this is a json file and needs to pass jslint, editors seem to basically show you exactly whatever is typed in the instructions, without formatting...  When viewed on roll20's character sheet template preview page, it has been magically formatted.  Is there a way to see what my json instructions will look like prior to making a PR and seeing it live?  Thanks

example of using a markdown previewer

vs character sheet template preview
March 18 (8 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I'd also be interested in this answer for writing the one-click install instructions for my scripts.
March 18 (8 years ago)

Edited March 18 (8 years ago)
Jakob
Sheet Author
API Scripter
I think you can just any old WYSIWYG markdown editor and replace all newlines in your file with \n afterwards. Seemed to do the trick for me when I did it for one-click instructions.
March 18 (8 years ago)
Lithl
Pro
Sheet Author
API Scripter

Jakob said:

I think you can just any old WYSIWYG markdown editor and replace all newlines in your file with \n afterwards. Seemed to do the trick for me when I did it for one-click instructions.
And replace " with \".

Most of the Markdown-in-JSON I've written has been directly in the JSON file, but I think I might have a Markdown renderer in my head. >.>
March 18 (8 years ago)

Edited March 18 (8 years ago)
vÍnce
Pro
Sheet Author
Thank you for your comments.  The problem really isn't with the markdown.  What about getting the json to pass a jslint inspection? Do I need to do something else before running the json thru jslint because it has too many errors to complete the inspection if I simply paste my markdown into the instructions value.  Seems that jslint wants everything on a single line (no line breaks), spaces, no tabs, etc.
example of what I want to include (key:value for instructions only)
"instructions": "# Pathfinder Character Sheet

## Key features
- Tab navigation: tabs allow for better organization and faster navigation. 
- Repeating fields: add as many rows as needed for attacks, abilities, feats, spells, inventory, etc.   
- Show/hide sub-sections: there are many options to show/hide sections of the sheet.
- Settings/configuration tab: show/hide advanced features such as unchained skills and macro-text fields, customize your sheet with font and background choices, header images for roll templates, and much more. 
- Auto-calculated attributes: ability scores & mods, Skills, HP, Saves, total-attack/damage as guided by the rules as written.  Most calculations are handled using sheet worker scripts(javascript) which helps to significantly enhance the sheet's performance.
- Conditions and Buffs: toggle conditions and create buffs that automatically adjust attributes across the sheet.
- NPC/Monster Parser: drag/drop monsters from the compendium bestiary to the sheet.
- HeroLab import: import HeroLab characters to the sheet.
- Menu Buttons: use section-specific buttons to produce a menu of relevant roll choices to chat.
- and too many features to list...

### Attributes
Mouse over any field to get its attribute name to help with token/ability macros.
Many field labels also include helpful title text giving a brief explanation of the attribute.
All field titles follow Roll20's attribute syntax, ie. AC would be displayed as \"@{AC}\" on mouse-over.

### Rolls
You can mouse over any button roll to get its attribute/ability name to help with token/ability macros.

Roll button titles follow Roll20's ability syntax, using the selected token, ie. \"%{selected|STR-check}\" or \"@{selected|repeating_weapon_$X_attack-roll\"

### NPC stat block
Use the NPC/Monster parser from the NPC tab to drag/drop monsters from the compendium.  You may also enter attribute data directly on the NPC tab for easy stat-block input.

## Additional Notes
Use the [Pathfinder Sheet Guide](https://wiki.roll20.net/Pathfinder_Character_Sheet) on the Roll20 wiki for more details.

Questions, comments, suggestions, please post in the Character Sheets forum: [Pathfinder sheet thread 6](https://app.roll20.net/forum/post/4735667/pf-pathfinder-sheet-thread-6)

## Special Thanks
**Translations: **
 - 白貓 (Traditional Chinese and the first translation done to the Pathfinder sheet.)

**Sam M.**(original sheet author)

And... everyone in the Roll20 community and character sheet beta test game.  Thank you for your assistance and support.",

March 18 (8 years ago)
Jakob
Sheet Author
API Scripter
What I said above, you just need to replace characters that JSON doesn't like. You've already escaped all the double quotes; you need to replace all line breaks with \n, replace tabs with \t )although I don't see any tabs in your code), etc... .
But really, the only thing I see in your markdown that would not work are the line breaks. So just put \n whereever there's a line break using a tool of your choice, and you should be good to go...
March 18 (8 years ago)
vÍnce
Pro
Sheet Author

Jakob said:

What I said above, you just need to replace characters that JSON doesn't like. You've already escaped all the double quotes; you need to replace all line breaks with \n, replace tabs with \t )although I don't see any tabs in your code), etc... .
But really, the only thing I see in your markdown that would not work are the line breaks. So just put \n whereever there's a line break using a tool of your choice, and you should be good to go...
Coolio.  Thanks