diff options
| author | Hsieh Chin Fan <pham@topo.tw> | 2024-10-06 14:12:26 +0800 |
|---|---|---|
| committer | Hsieh Chin Fan <pham@topo.tw> | 2024-10-07 16:15:56 +0800 |
| commit | 31cc063c23df57832779b004a22d85cd6cf5caf0 (patch) | |
| tree | 75fd8c2ac9f039e0f3ba4a26c496a2dada671b0e /src | |
| parent | 2f82762ace33a0986c1ec3fc72da83113810dae9 (diff) | |
feat: new default content for tutorial
Diffstat (limited to 'src')
| -rw-r--r-- | src/editor.mjs | 49 |
1 files changed, 46 insertions, 3 deletions
diff --git a/src/editor.mjs b/src/editor.mjs index fb73f93..46d91af 100644 --- a/src/editor.mjs +++ b/src/editor.mjs | |||
| @@ -43,8 +43,51 @@ const toggleEditing = () => { | |||
| 43 | 43 | ||
| 44 | // Content values for editor | 44 | // Content values for editor |
| 45 | 45 | ||
| 46 | const defaultContent = | 46 | const defaultContent = `<br> |
| 47 | '## Links\n\n- [Go to marker](geo:24,121?id=foo,leaflet&text=normal "Link Test")\n\n```map\nid: foo\nuse: Maplibre\n```\n' | 47 | |
| 48 | > <big>Hello My Friend! This is DumbyMap!</big> | ||
| 49 | |||
| 50 | <br> | ||
| 51 | |||
| 52 | \`\`\`map | ||
| 53 | use: Leaflet | ||
| 54 | height: 120px | ||
| 55 | XYZ: https://tile.openstreetmap.jp/styles/osm-bright/512/{z}/{x}/{y}.png | ||
| 56 | \`\`\` | ||
| 57 | |||
| 58 | |||
| 59 | DumbyMap generates **interactive document with maps** from raw texts. | ||
| 60 | |||
| 61 | You can use it to: | ||
| 62 | |||
| 63 | 1. [Roll a Dice] for a new map | ||
| 64 | 2. Click on [GeoLink][example-geolink] for maps. Or Add a new one by **Right Click** on map. | ||
| 65 | 3. Add more contents into [Editor] by text in [Markdown] | ||
| 66 | 4. Generated document is at left hand side, **Right click** for context menu. | ||
| 67 | You can: | ||
| 68 | + Select content block for browsing | ||
| 69 | + Switch layouts for various use cases | ||
| 70 | |||
| 71 | |||
| 72 | If you want know more, take a look at subjects below: | ||
| 73 | 1. [How to write text in Markdown?][subject] | ||
| 74 | 2. [How can I save contents for next time][subject] | ||
| 75 | 3. [I want XXX feature in maps][subject] | ||
| 76 | 3. [I am a expeienced developer, show me what you got!][subject] | ||
| 77 | |||
| 78 | |||
| 79 | <br> | ||
| 80 | |||
| 81 | > Have Fun ~ | ||
| 82 | |||
| 83 | <br> | ||
| 84 | |||
| 85 | [Roll a dice]: #Click%20it! "=>.mde-roll" | ||
| 86 | [example-geolink]: geo:24,121?xy=121,24 | ||
| 87 | [Markdown]: https://www.markdownguide.org/basic-syntax/ | ||
| 88 | [Editor]: #This%20is%20editor! "=>.editor" | ||
| 89 | [subject]: placeholder` | ||
| 90 | |||
| 48 | const editor = new EasyMDE({ | 91 | const editor = new EasyMDE({ |
| 49 | element: textArea, | 92 | element: textArea, |
| 50 | initialValue: defaultContent, | 93 | initialValue: defaultContent, |
| @@ -68,7 +111,7 @@ const editor = new EasyMDE({ | |||
| 68 | toolbar: [ | 111 | toolbar: [ |
| 69 | { | 112 | { |
| 70 | name: 'roll', | 113 | name: 'roll', |
| 71 | title: 'Roll a dice', | 114 | title: 'Roll a Dice', |
| 72 | text: '\u{2684}', | 115 | text: '\u{2684}', |
| 73 | action: () => addMapRandomlyByPreset() | 116 | action: () => addMapRandomlyByPreset() |
| 74 | }, | 117 | }, |