https://kotlinlang.org logo
#dokka
Title
a

António Bastião

02/03/2021, 12:02 PM
I’ve to make an update to my previous message. I’ve found the page that shows how to create a plugin, but I don’t necessarily understand what’s written there and the code has a bit lack of documentation. Which is ironic since is a tool to create documentation. Is there any tutorial for noobs? Create documentation as JSON is quite important to me because I’ve a way to post the documentation from CI pipeline or create HTML documentation and upload manually. I would like to avoid the second one and maybe the plugin, if can manage to create it might be useful to other people too.
m

Marcin Aman

02/03/2021, 12:09 PM
Are you talking about this template: https://github.com/Kotlin/dokka-plugin-template And the developer documentation: https://kotlin.github.io/dokka/1.4.20/developer_guide/introduction/ If so, please be a little bit more specific in what you don’t understand. I’ll try to help
k

Kamil Doległo

02/03/2021, 12:11 PM
I’d also like to point out that creating a JSON format will take a lot of effort, as you’d probably have to write a new DocumentableToPagetTranslator, create a new Page model and also create a new Renderer
a

António Bastião

02/03/2021, 12:11 PM
Kamil, that’s expected. But this was the only way I could imagine. Any suggestions are welcome.
k

Kamil Doległo

02/03/2021, 12:15 PM
Could you elaborate a little more on your issue? Sorry, I didn’t quite catch it, you’d like to generate the documentation from the CI pipeline and you can’t do that?
a

António Bastião

02/03/2021, 12:17 PM
Yes, I’ve an endpoint available that accepts JSON. So I can post the generated documentation. The other way is edit the page manually where I’ve to present the documentation. Maybe there’s an easier solution. Parse the HTML files with jsoup.
m

Marcin Aman

02/03/2021, 12:22 PM
Okey, but do you want to send whole documentation for the project in 1 json to publish it? Also: why zipping the html docs and sending them isn’t an option?
a

António Bastião

02/03/2021, 12:28 PM
The idea was actually have a way to keep updating the pages based on the diff. And would be a file per json. That would generate a similar structure that we get when generating the HTML documentation. I’ll try to find another solution and maybe the way is keep doing it manually.
k

Kamil Doległo

02/03/2021, 12:29 PM
The idea was actually have a way to keep updating the pages based on the diff.
Can’t you then use a
git diff
on html files and upload those diffs ?
JSON format does not seem like a fix for that. You’d still have to have some sort of post processing to display them nicely
a

António Bastião

02/03/2021, 12:33 PM
But the post I already have it. And the endpoint accepts JSON. That won’t change.
I’ll search another solution. Thank you
One more thing, my idea was take advantage of all the data classes and use serialization or Gson to create my JSON strings
f

Felix Honer

02/13/2022, 2:58 PM
have you found any solution for that? I’m also looking for a way to generate json files in order to feed spring-auto-restdocs
a

António Bastião

03/17/2022, 8:36 AM
Actually no. It was pointed that could take some time and my former company decided to drop the project. Actually I think it’s feasible and not that hard, but I quit too do to lack o personal time.
6 Views