Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Consider adding "Edit on Github" to developer reference #647
Comments
|
@icook Thanks! Do you have an idea how you would implement this? (Taking into account that each page is build using several files). As far as I'm concerned, I like the idea but I guess this depends how it's implemented (and if this feature creates other issues). Otherwise maybe a simple "Participate" link in the menu pointing to the relevant README text https://github.com/bitcoin/bitcoin.org#developer-documentation would do? FWIW, the "Report An Issue" link already lets people report an issue and suggest improvements while automagically inserting a contextual link to the relevant subsection in the GitHub issue. |
|
@icook thanks for the complement! A possible idea would be to have a "[edit]" link next to each section (H2) title similar to what MediaWiki does. Manually adding a link for each section which points to the appropriate file would be pretty easy, and we could probably point it to the edit interface on GitHub for quick edits. |
|
I just tested to see what a visitor who knows nothing about GitHub and didn't already have forked the repository would have to deal with by visiting a sample "Edit this page" link (https://github.com/bitcoin/bitcoin.org/edit/master/_includes/guide_contracts.md). After creating an account, I was positively surprised, GitHub seems to make it simplier than I thought (see screenshot below). |
icook
commented
Nov 14, 2014
|
It looks like Jekyll might already have it covered: Ctrl+F For styling I was thinking something in the vein of Readthedocs on the top right. It would be cool to jump to a specific section, but I'm not sure on the Github support for that. |
|
@icook This would need testing, but I think There is the MediaWiki-like option like what @harding suggested, or if the idea sounds good, I can provide the javascript to add a link in the table of content that would work like the current "Report An Issue" link, so long as we put enough information on the page (e.g. data-sourcefile="data" attribute near the titles) that javascript can use to find the source file associated with the current subsection. |
|
@saivann Nice! I hadn't thought about how hard it might be for new GitHub users. A javascript-updated link would be much better because we have one case (the RPC docs) where a single section is split across multiple files ( While we're at it, it might be nice to move the meta options over the top of the table of contents so they're always visible. For example ([X] is an icon):
The top links would have tooltips with expanded descriptions. |
icook
commented
Nov 16, 2014
|
@harding I like it. Makes it more clear that these aren't other content pages. @saivann I went ahead and gave it a shot and |
|
@icook @harding Here's one way of doing it (icon missing and commit a bit poorly tested): Live preview: @harding I like your suggested layout too! @icook if you have time to play with CSS/HTML/Javascript and see if you can make it always always visible, you're welcome! Otherwise I may have time to try it later. I don't know how easy it will be - the toc should gracefully adjust positioning and size while scrolling at the top, middle and bottom of the page, with content that sometimes require a scrollbar, sometimes not. |
|
@saivann nice! Basic testing all looked good to me. How about a plus-minus for the symbol, like the unicode ± (U177 in the basic latin1 range)? I think that's pretty much the universal symbol for revision control, which seem applicable here. (And GitHub's edit interface seems to have improved since I last used it, making editing easier for markdown novices.) |
icook
commented
Nov 17, 2014
|
@harding ± sounds good, otherwise probably an icon similar to fontawesome's Github specific symbol. @saivann Looks great! I can probably add a proper icon tomorrow. Not sure what you meant by showing up all the time? My brief look at it seemed to be fine minus the icon. |
|
@icook I just added a ± icon I had made previously today to the branch and updated the live preview (just so we don't duplicate effort, unless you think you can provide something better); The fontawesome icon I think is cool and probably more friendly, however by making our own icon we can avoid the hassle that comes with inserting content with various licenses in the same directory. My understanding of @harding's comment is he suggested we could have this moved at the top of the toc (table of contents) and stylize the toc to make sure it always remain visible like a toolbox. Currently, if you visit a long toc like the Bitcoin Core RPC (http://bitcointest2.us.to/en/developer-reference#getaddressesbyaccount), you'll see that these buttons are not visible. There's probably a way to avoid this issue. I'm not sure though if this toolbox would interfere too much with the content if moved at the top, personally, I tend to think it's more appropriate at the bottom of the screen. |
|
In my opinion, the current version looks good enough for a pull request. Thanks @saivann for the work and @icook for the idea! To clarify my earlier comment, I would like (wishlist) a one-line high, always-visible toolbox with the overview, issue, and edit links. I have no preference for where the toolbox appears on the page, and hiding it on mobile layouts seems fine to me. If implementing it will be difficult with the current layout, I suggest we just add it as a comment to issue #596 as an idea for a future redesign of the docs layout. |
saivann
referenced this issue
Nov 17, 2014
Merged
Add contextual link to source file on GitHub in devel-doc #648
|
Pull req -> done. TBH, I think making a fixed-position always visible toolbox might either be super simple, or need to rewrite a moderate chunk of CSS, HTML and javascript. @icook Please let me know if you're interested to work on it. I should be around if you have any issues or questions. |
icook
commented
Nov 19, 2014
|
@saivann I'm probably good for now. I'll be trying to make some docs PRs occasionlly tho! |
icook
closed this
Nov 19, 2014
|
@icook Very appreciated, thanks!! |

icook commentedNov 14, 2014
First I wanted to say I really like the new dev docs. I really wish it existed when I started reading about bitcoin dev.
I enjoy contributing to docs like these when possible, but I've found I'm much more likely to do so if there's an easy link back to the actual file that generated the page. Would you accept a pull request if I added this?