You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks.md
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -69,10 +69,9 @@ We use [Linguist](https://github.com/github/linguist) to perform language detect
69
69
{% if mermaid %}
70
70
## Creating diagrams
71
71
72
-
You can use Mermaid syntax to add diagrams. For more information, see "[Creating diagrams](/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams)."
72
+
You can also use code blocks to create diagrams in Markdown. GitHub supports Mermaid, geoJSON, topoJSON, and ASCII STL syntax. For more information, see "[Creating diagrams](/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams)."
73
73
74
74
{% endif %}
75
-
76
75
## Further reading
77
76
78
77
-[{% data variables.product.prodname_dotcom %} Flavored Markdown Spec](https://github.github.com/gfm/)
Copy file name to clipboardExpand all lines: content/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams.md
+126-1Lines changed: 126 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,13 @@ versions:
6
6
shortTitle: Create diagrams
7
7
---
8
8
9
-
You can use Mermaid syntax to create diagrams. Mermaid is a Markdown-inspired tool that renders text into diagrams. For example, Mermaid can render flow charts, sequence diagrams, pie charts and more. For more information, see the [Mermaid documentation](https://mermaid-js.github.io/mermaid/#/).
9
+
## About creating diagrams
10
+
11
+
You can create diagrams in Markdown using three different syntaxes: mermaid, geoJSON and topoJSON, and ASCII STL.
12
+
13
+
## Creating Mermaid diagrams
14
+
15
+
Mermaid is a Markdown-inspired tool that renders text into diagrams. For example, Mermaid can render flow charts, sequence diagrams, pie charts and more. For more information, see the [Mermaid documentation](https://mermaid-js.github.io/mermaid/#/).
10
16
11
17
To create a Mermaid diagram, add Mermaid syntax inside a fenced code block with the `mermaid` language identifier. For more information about creating code blocks, see "[Creating and highlighting code blocks](/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks)."
12
18
@@ -31,3 +37,122 @@ graph TD;
31
37
**Note:** You may observe errors if you run a third-party Mermaid plugin when using Mermaid syntax on {% data variables.product.company_short %}.
32
38
33
39
{% endnote %}
40
+
41
+
## Creating geoJSON and topoJSON maps
42
+
43
+
You can use geo/topoJSON syntax to create interactive maps. To create a map, add geoJSON or topoJSON inside a fenced code block with the `geojson` or `topojson` syntax identifier. For more information, see "[Creating and highlighting code blocks](/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks)."
For more information on working with `.geojson` and `.topojson` files, see "[Working with non-code files](/repositories/working-with-files/using-files/working-with-non-code-files#mapping-geojson-files-on-github)."
112
+
113
+
114
+
## Creating STL 3D models
115
+
116
+
You can use ASCII STL syntax directly in markdown to create interactive 3D models. To display a model, add ASCII STL syntax inside a fenced code block with the `stl` syntax identifier. For more information, see "[Creating and highlighting code blocks](/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks)."
117
+
118
+
For example, you can create a simple 3D model:
119
+
120
+
<pre>
121
+
```stl
122
+
solid cube_corner
123
+
facet normal 0.0 -1.0 0.0
124
+
outer loop
125
+
vertex 0.0 0.0 0.0
126
+
vertex 1.0 0.0 0.0
127
+
vertex 0.0 0.0 1.0
128
+
endloop
129
+
endfacet
130
+
facet normal 0.0 0.0 -1.0
131
+
outer loop
132
+
vertex 0.0 0.0 0.0
133
+
vertex 0.0 1.0 0.0
134
+
vertex 1.0 0.0 0.0
135
+
endloop
136
+
endfacet
137
+
facet normal -1.0 0.0 0.0
138
+
outer loop
139
+
vertex 0.0 0.0 0.0
140
+
vertex 0.0 0.0 1.0
141
+
vertex 0.0 1.0 0.0
142
+
endloop
143
+
endfacet
144
+
facet normal 0.577 0.577 0.577
145
+
outer loop
146
+
vertex 1.0 0.0 0.0
147
+
vertex 0.0 1.0 0.0
148
+
vertex 0.0 0.0 1.0
149
+
endloop
150
+
endfacet
151
+
endsolid
152
+
```
153
+
</pre>
154
+
155
+

156
+
157
+
For more information on working with `.stl` files, see "[Working with non-code files](/repositories/working-with-files/using-files/working-with-non-code-files#3d-file-viewer)."
Copy file name to clipboardExpand all lines: content/repositories/working-with-files/using-files/working-with-non-code-files.md
+56-2Lines changed: 56 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -130,6 +130,12 @@ By default, the embedded renderer is 420 pixels wide by 620 pixels high, but you
130
130
131
131
{% endtip %}
132
132
133
+
{% if mermaid %}
134
+
### Rendering in Markdown
135
+
136
+
You can embed ASCII STL syntax directly in Markdown. For more information, see "[Creating diagrams](/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams#creating-stl-3d-models)."
137
+
{% endif %}
138
+
133
139
## Rendering CSV and TSV data
134
140
135
141
GitHub supports rendering tabular data in the form of *.csv* (comma-separated) and .*tsv* (tab-separated) files.
@@ -240,7 +246,7 @@ When you click the paper icon on the right, you'll also see the changes made to
Maps on {% data variables.product.product_name %} use [Leaflet.js](http://leafletjs.com) and support all the geometry types outlined in [the geoJSON spec](http://www.geojson.org/geojson-spec.html) (Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection). TopoJSON files should be type "Topology" and adhere to the [topoJSON spec](https://github.com/mbostock/topojson/wiki/Specification).
246
252
@@ -281,6 +287,12 @@ By default, the embedded map 420px x 620px, but you can customize the output by
281
287
282
288
{% endtip %}
283
289
290
+
{% if mermaid %}
291
+
### Mapping in Markdown
292
+
293
+
You can embed geoJSON and topoJSON directly in Markdown. For more information, see "[Creating diagrams](/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams#creating-geojson-and-topojson-maps)."
294
+
{% endif %}
295
+
284
296
### Clustering
285
297
286
298
If your map contains a large number of markers (roughly over 750), GitHub will automatically cluster nearby markers at higher zoom levels. Simply click the cluster or zoom in to see individual markers.
@@ -299,7 +311,7 @@ Additionally, if your `.geojson` file is especially large (over 10 MB), it is no
299
311
300
312
It may still be possible to render the data by converting the `.geojson` file to [TopoJSON](https://github.com/mbostock/topojson), a compression format that, in some cases, can reduce filesize by up to 80%. Of course, you can always break the file into smaller chunks (such as by state or by year), and store the data as multiple files within the repository.
-[Gallery of Jupyter Notebooks](https://github.com/jupyter/jupyter/wiki/A-gallery-of-interesting-Jupyter-Notebooks)
342
+
343
+
{% if mermaid %}
344
+
## Displaying mermaid files on {% data variables.product.prodname_dotcom %}
345
+
346
+
{% data variables.product.product_name %} supports rendering Mermaid files within repositories. Commit the file as you would normally using a `.mermaid` or `.mmd` extension. Then, navigate to the path of the Mermaid file on {% data variables.product.prodname_dotcom %}.
347
+
348
+
For example, if you add a `.mmd` file with the following content to your repository:
If your chart does not render at all, verify that it contains valid Mermaid Markdown syntax by checking your chart with the [Mermaid live editor](https://mermaid.live/edit).
365
+
366
+
If the chart displays, but does not appear as you'd expect, you can create a new [feedback discussion](https://github.com/github/feedback/discussions/categories/general-feedback), and add the `mermaid` tag.
367
+
368
+
#### Known issues
369
+
370
+
* Sequence diagram charts frequently render with additional padding below the chart, with more padding added as the chart size increases. This is a known issue with the mMermaid library.
371
+
* Actor nodes with popover menus do not work as expected within sequence diagram charts. This is due to a discrepancy in how JavaScript events are added to a chart when the Mermaid library's API is used to render a chart.
372
+
* Not all charts are a11y compliant. This may affect users who rely on a screen reader.
373
+
374
+
### Mermaid in Markdown
375
+
376
+
You can embed Mermaid syntax directly in Markdown. For more information, see "[Creating diagrams](/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams#creating-mermaid-diagrams)."
0 commit comments