boostorg / docca

Boost.Book XSLT C++ documentation system
Boost Software License 1.0
17 stars 22 forks source link

"Edit this page" link #123

Open vinniefalco opened 2 years ago

vinniefalco commented 2 years ago

Would it be possible to have an "edit this page" link on every generated doc page and in each page of the exposition? I guess it should link to the GitHub repository, I believe GitHub has some API that lets you edit a file in the repo.

evanlenz commented 2 years ago

Ooh, that sounds cool (and pretty feasible, I think). However, the trick would be preserving the changes after another doc build. Without some relatively fancy mechanism (and I have no aversion to relatively fancy mechanisms when they do something valuable!), the manual changes would get clobbered in the very next build (and would have to manually get reapplied). Does this all make sense what I’m saying? Or did I misunderstand what you’re asking about?

vinniefalco commented 2 years ago

uhhhhh...GitHub has an inline editor which submits the change as a pull request

evanlenz commented 2 years ago

Oh, I think I did misunderstand! You’re talking about editing the source files! Duh, brain is a little slow today. 😅 Yes, we should be able to make this work. Devil in the details, but any obstacles have got to be surmountable.

vinniefalco commented 2 years ago

image

vinniefalco commented 2 years ago

The link is formed like this

https://github.com/boostorg/docca/edit/develop/LICENSE_1_0.txt
vinniefalco commented 2 years ago

it could only apply to the develop branch though.... so if you are trying to edit say, an older Boost version (1.77 for example) when you press the button you will be editing the develop branch version of the file.

vinniefalco commented 2 years ago

This is starting to sound lame... lol

vinniefalco commented 2 years ago

There's no way to bring the edit box focus directly to the line in question, and there's no way for the xslt to know which line in the source file it corresponds to in the first place. Not very streamlined.