Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs Updates #1287

Open
RieMars opened this issue Dec 9, 2022 · 3 comments
Open

Docs Updates #1287

RieMars opened this issue Dec 9, 2022 · 3 comments

Comments

@RieMars
Copy link

RieMars commented Dec 9, 2022

Could the docs be reviewed in the following areas?

Suggestion 1 - Import Note
https://svgjs.dev/docs/3.0/getting-started/
Current:

'Note: All properties that were former available on the global SVG object need to be imported now, see example below:'

Revised:

'Note: Since X.X.X, All properties that were formerly available on the global SVG object need to be imported now, see example below:'

Where X.X.X is the version, as I don't know what version it started with if I'm using a legacy codebase that I'm updating. As many people will only hit this as a problem when they're getting bundler errors.

Suggestion 2 - Import Example
https://svgjs.dev/docs/3.0/getting-started/

import { SVG, extend as SVGextend, Element as SVGElement } from '@svgdotjs/svg.js'

Could use an actual example, rather than generic pseudo-code. Not being familiar with the whole code base, I thought that Element was going to bring in all the elements. And is there any need to alias? If so maybe explain why?
Also if you have some sample code using SVG.ClipPath() is there any way to import the element so that sample code works?

Suggestion 3 - ClipPath Defs
https://svgjs.dev/docs/3.0/shape-elements/
Whilst there is a discussion of how the constructor methods (eg. draw.clipPath() )and raw constructor ( clip = new ClipPath() ) difference here, there's no explanation in the docs of how ClipPath needs to be added to Defs. Adding something about it would be helpful, whether that's at the top of that doc page or within the ClipPath section, not sure the best place, but it's undocumented at the moment.

Bug?
When using the left nav to navigate between directly to an API (eg. SVG.Symbol and SVG.Circle) or when using the search, it doesn't go to the right heading (inline anchor) on a given page the first time. It seems to need to be clicked twice.

Benefits

  • Making the docs easier to understand to newcomers or people who aren't deeply knowledgeable of SVG, JS and this project
@Fuzzyma
Copy link
Member

Fuzzyma commented Dec 9, 2022

Thanks for your suggestions. The docs are open source as well and can be found at https://github.com/svgdotjs/svgdotjs.github.io.

A PR is really welcome and will be merged asap :)

@RieMars
Copy link
Author

RieMars commented Dec 9, 2022

Ok sure, just I quickly checked it out and is the version of the docs in that repository the same as live?
https://svgjs.dev/docs/3.0/getting-started/ doesn't have the same text as: https://github.com/svgdotjs/svgdotjs.github.io/blob/source-3.1/content/3-getting-started/default.txt
Couldn't see the line:

import { SVG, extend as SVGextend, Element as SVGElement } from '@svgdotjs/svg.js'

I didn't want to start making suggestions in code if I'm not working on the latest.

@Fuzzyma
Copy link
Member

Fuzzyma commented Dec 9, 2022

There is a version selector at the top of the docs page. The docs currently show 3.0 by default (which is also a bug). You can check against the 3.1 version by selection it in the dropdown: https://svgjs.dev/docs/3.1/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants