1# secedit2head
2[DokuWiki]: http://www.dokuwiki.org
3[DokuWiki] plugin to move section edit buttons from bottom to section header
4
5## General Info
6Having the section edit button below each section added more space between sections than I wanted for my project. Some CSS of course would work, but relocating it to the same line as the section header seemed a more logical solution. Not only will it now occupy space already used for the section title,  but for long pages with long sections, it also makes it quick and easy to go to top of section (say, via ToC) and have the Edit option right there.
7
8## Details
9The plugin adds Javascript inline at the end of page content creation. It then runs two checks for (default DokuWiki config) deferred Javascript loading.
10  - first, that jQuery has loaded
11  - second, that DokuWiki's page.js has run the code that creates the section wrappers
12
13It only then copies and removes the original edit node and **prepends** it to the h# section heading. All structure, ids, classes are kept in tact. Hover events for *section_highlight* are updated for the change in location to correctly find the parent wrapper to highlight on hover.
14
15### Before
16![Before](https://github.com/jefs42/secedit2head/blob/main/screenshots/before.png)
17### After
18![After](https://github.com/jefs42/secedit2head/blob/main/screenshots/after.png)
19