boostorg / docca

Boost.Book XSLT C++ documentation system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Edit this page" link

vinniefalco opened this issue · comments

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.

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?

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

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.

The link is formed like this

https://github.com/boostorg/docca/edit/develop/LICENSE_1_0.txt

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.

This is starting to sound lame... lol

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.