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

Generate single page #19

Open
cristaloleg opened this issue Apr 29, 2021 · 12 comments
Open

Generate single page #19

cristaloleg opened this issue Apr 29, 2021 · 12 comments

Comments

@cristaloleg
Copy link

Hi, thank for the golds it's amazing. I was looking for a param, where I can generate docs for few packages (with a common root, but probably it's not so important) but haven't found.

Is there a chance that this param can be added? Thanks!

@zigo101
Copy link
Collaborator

zigo101 commented Apr 29, 2021

@cristaloleg
Could you elaborate more?

Is the idea the same as the ones described in #9 and #3?

@zigo101
Copy link
Collaborator

zigo101 commented May 25, 2021

ping @cristaloleg

@cristaloleg
Copy link
Author

Woah, have missed your previous comment. So, my case was "I want to collect all the declarations in 1 HTML file".

Suppose I've a Go module with 3 packages foo, bar and bar/baz. In the end I would like to have doc.html with foo, bar and bar/baz documentation (funcs, types, consts, etc).

I don't think it's the same as #3 or #9

@zigo101
Copy link
Collaborator

zigo101 commented May 25, 2021

Is it supposed for one module or for all parsed packages?

The page might be very long. So if it is created, it might be best to list the items as an index table.

@cristaloleg
Copy link
Author

Yep, well, there was a filter to skip mocks or few codegen packages.

Agree, it can be long, but you've 1 doc which is super easy to grep and host (not the best cast but was good solution for one of our projects and non-tech team).

@zigo101
Copy link
Collaborator

zigo101 commented May 25, 2021

So it is a page merged all package pages.
The page shouldn't include std packages, right?
And how about other 3rd-party dependency packages?
Is it ok to link their items to pkg.go.dev?

And how to handle source code pages?
To avoid generating source code pages, is it acceptable to link source code to external websites?

If std and 3rd-party dependencies are excluded, using external source code, and disabling some other features (id-ref pages and method-implementation pages), it might be feasible for small Go modules.

@cristaloleg
Copy link
Author

Exactly.
No std packages (however this can be a good feature, but most cases will exclude stdlib).
No deps or vendor, only private repos.
What do you mean by linking items to pkg.go.dev?

Source code pages was linked to the local machine, so running doc generator will produce local working HTML page.

@zigo101
Copy link
Collaborator

zigo101 commented May 25, 2021

What do you mean by linking items to pkg.go.dev?

In package doc pages, there are many links to other packages. It might be not a good idea to disable these links,

And currently, Golds will generate a page for each source code file.
And there are many links from package docs pages to source code pages.

As you only need one page, I think you might don't want the source code pages to be generated.
So is it ok to change the links to external source code hosting websites?

@zigo101
Copy link
Collaborator

zigo101 commented May 25, 2021

As you only need one page, I think you might don't want the source code pages to be generated.
So is it ok to change the links to external source code hosting websites?

Aha, it looks this is an overthinking.
But should the source code pages of your private projects be generated?
If not, then the links from you package doc page to these source code pages will be disabled.

@cristaloleg
Copy link
Author

Probably should be, but this was out of scope for my original questions :)

@zigo101
Copy link
Collaborator

zigo101 commented May 25, 2021

OK, I will add this to the todo list now.
But I think it might not be implemented soon.

The last question: how to determine your private packages?
The packages in the current directory?

@cristaloleg
Copy link
Author

Yep, exactly, packages in the current directory.

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

2 participants