-
Hi all 👋🏻 I think that using SVG for images (mainly diagrams) is something that would bring a lot of benefits for authors and readers.
My ask: If you are working on pages that have
Before:
After:
If you're stuck, or would like someone else to convert it for you, ask us for help! Labels: I've created a label Example PR: About Mermaid syntax: There is a proposal for us to use Mermaid in content, and while we don't support it yet, there's potential for us to keep track of the Mermaid equivalents of diagrams until it is supported in future. Sharing and editing diagrams when you have the Mermaid source is straightforward, for example, try copying and pasting the following mermaid source into https://www.mermaidchart.com: ```mermaid
%%{init: { "sequence": { "wrap": true, "width":250, "noteAlign": "center", "messageAlign": "center" }} }%%
sequenceDiagram
participant Client
participant Server
Note left of Client: Request resource
Client->>Server: GET /doc HTTP/1.1
Note right of Server: Resource moved<br>Respond with new location
Server-->>Client: HTTP/1.1 301 Moved Permanently<br/>Location: /doc_new
Note left of Client: Request resource at new location
Client->>Server: GET /doc_new HTTP/1.1
Note right of Server: Return resource
Server-->>Client: HTTP/1.1 200 OK
``` It renders in GFM anyway: Example chart rendered in GFM:%%{init: { "sequence": { "wrap": true, "width":250, "noteAlign": "center", "messageAlign": "center" }} }%%
sequenceDiagram
participant Client
participant Server
Note left of Client: Request resource
Client->>Server: GET /doc HTTP/1.1
Note right of Server: Resource moved<br>Respond with new location
Server-->>Client: HTTP/1.1 301 Moved Permanently<br/>Location: /doc_new
Note left of Client: Request resource at new location
Client->>Server: GET /doc_new HTTP/1.1
Note right of Server: Return resource
Server-->>Client: HTTP/1.1 200 OK
Focus area: I think the HTTP docs are a great place to focus some effort. There are a few great candidates (sequence diagrams in PNG format). For those who are interested, I will reply to this discussion with a list of files that we can take a look at. Thanks! Thanks a lot, looking forward to your thoughts! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
I think the sequence diagrams under HTTP are a really great opportunity for housekeeping and optimization. Currently this looks like 42 images (not all are sequence diagrams, though): find ./files/en-us/web/http -type f -name '*.png' | wc -l
42 update: There are 14 remaining as of Nov 2024: find ./files/en-us/web/http -type f -name '*.png'
./files/en-us/web/http/content_negotiation/httpnego3.png
./files/en-us/web/http/content_negotiation/httpnegoserver.png
./files/en-us/web/http/content_negotiation/httpnego.png
./files/en-us/web/http/messages/binary_framing2.png
./files/en-us/web/http/messages/httpmsg2.png
./files/en-us/web/http/messages/httpmsgstructure2.png
./files/en-us/web/http/messages/http_request_headers3.png
./files/en-us/web/http/messages/http_response_headers3.png
./files/en-us/web/http/connection_management_in_http_1.x/http1_x_connections.png
./files/en-us/web/http/connection_management_in_http_1.x/httpsharding.png
./files/en-us/web/http/cors/errors/cors-error2.png
./files/en-us/web/http/caching/request-collapse.png
./files/en-us/web/http/caching/type-of-cache.png
./files/en-us/web/http/cookies/cookie-basic-example.png |
Beta Was this translation helpful? Give feedback.
-
I understand. These files are PNGs because SVGs were not allowed back then, and the source files were stored elsewhere and… lost. I'm really happy to see something like Mermaid coming. It will also help us unify the look and feel of diagrams throughout MDN. |
Beta Was this translation helpful? Give feedback.
-
A note here: when we go ahead to use svg format instead of |
Beta Was this translation helpful? Give feedback.
-
At the moment, I think I can close this with a recommendation to use SVG where possible, and some information on where to put the assets. Adding this hint to writing guidelines in: Thanks to everyone for the input and help! |
Beta Was this translation helpful? Give feedback.
At the moment, I think I can close this with a recommendation to use SVG where possible, and some information on where to put the assets. Adding this hint to writing guidelines in:
Thanks to everyone for the input and help!