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

New template #30

Closed
warpdesign opened this issue Dec 22, 2017 · 10 comments
Closed

New template #30

warpdesign opened this issue Dec 22, 2017 · 10 comments

Comments

@warpdesign
Copy link
Contributor

warpdesign commented Dec 22, 2017

Just to let you know the documentation for AthenaJS is now using Docma with a new template (which is based on Docma's default template) and is available here :)

@onury
Copy link
Owner

onury commented Dec 22, 2017

Glad to hear that. Nice work !

@mojavelinux
Copy link

I really like the type definition links you added. Is there a reason you didn't link to types within the API too? (For example, linking from the MapEvent constructor to the Map type). That would really be a nice feature to have in docma.

@onury onury closed this as completed Dec 26, 2017
@onury
Copy link
Owner

onury commented Dec 26, 2017

Closing this now. We can improve the template(s) more once we get v2 out.

@warpdesign
Copy link
Contributor Author

warpdesign commented Dec 28, 2017

@mojavelinux Yes, there is a reason. I wanted to do it for non-web API types too but it's not that easy since links can be in different API pages.

For example, the ?api=map section contains documentation for Map, MapEvent, Tile classes but there's no way for me to know that when the links are generated.

I could hardcode it quite easily but I wanted something could be reused by anyone so I decided to leave it as is for now.

@mojavelinux
Copy link

Thanks for the explanation. That helps me think about how I'm going to approach this problem. I think links between types is essential in an API, so I'm going to need to find a way to do it if I'm going to be able to use docma for my API docs. This really does seem like something docma should be able to track internally.

@warpdesign
Copy link
Contributor Author

I guess it should be possible to do that by poking into documentation global var but I had some timing constraints cc @onury.

I'll have a look when I can find some free time.

@onury
Copy link
Owner

onury commented Dec 28, 2017

This should be a template feature, rather than docma builder core.
Each symbol is a bookmark on that route/page. You could link it via hash.
e.g. ?api=map#MapEvent

Linking could be done via a custom Docma/Dust Filter. So (for the default template) in the symbol partial, you'd do something like this;

<code class="symbol-type">{symbol|$type_linked}</code>

$type_linked would be a custom filter, used instead of $type filter.

docma.addFilter('type_linked', function (symbol) {
    // ...
});

I'll play with this in v2 branch, let you know.

@warpdesign
Copy link
Contributor Author

That's already what I am doing, the only problem was getting the correct api to link to.

@onury
Copy link
Owner

onury commented Dec 28, 2017

Alright. We can add a utility method to get link for a symbol in docma web-core.

@warpdesign
Copy link
Contributor Author

@mojavelinux It wasn't so hard after all: I added link to API objects in the documentation.

I also did the same thing for returned types and for extend types.

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

No branches or pull requests

3 participants