From ec7be0d6f6ccff9aaae0f1bd0461812c898e13e9 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 6 Apr 2018 16:41:11 +0200 Subject: erl_docgen: Add hover links for ghlink All functions, datatype and h3 headings have gotten a hover attribute that shows a link directly to the edit page on github for easy editing of documentation. The github link links to the maint branch. An early attempt was done to use the SHA of the current branch, but that did not work well as github can only take pull requests from branches. --- lib/erl_docgen/priv/css/otp_doc.css | 20 +++- lib/erl_docgen/priv/xsl/db_html.xsl | 209 ++++++++++++++++++++++++++++-------- 2 files changed, 185 insertions(+), 44 deletions(-) (limited to 'lib/erl_docgen') diff --git a/lib/erl_docgen/priv/css/otp_doc.css b/lib/erl_docgen/priv/css/otp_doc.css index 66ea09b53a..69ecf151e4 100644 --- a/lib/erl_docgen/priv/css/otp_doc.css +++ b/lib/erl_docgen/priv/css/otp_doc.css @@ -242,8 +242,24 @@ th { font-size: small; } -h3>a, h4>a{ - color: #1a1a1a !important; +.title_link { + color: #1a1a1a !important; + outline: none; +} + +.ghlink { + margin-left: -2.7em; /* .pencil.font-size + .pencil.padding.left + .pencil.padding.right = 2.7 */ + visibility: hidden; +} + +.pencil:before { + content: "\270D"; + color: #1a1a1a !important; + font-weight: bold; + font-size: 1.5em; + padding: .3em .6em .6em; + line-height: 1em; + font-family: mono; } hr{ diff --git a/lib/erl_docgen/priv/xsl/db_html.xsl b/lib/erl_docgen/priv/xsl/db_html.xsl index f9f3a356be..d92241277d 100644 --- a/lib/erl_docgen/priv/xsl/db_html.xsl +++ b/lib/erl_docgen/priv/xsl/db_html.xsl @@ -54,6 +54,19 @@ + + + + + + + + + + + + + -

- Data Types -

+ + Data Types +
- + - -

- + +

+ + + +

+
-
+
+ + + + +
@@ -904,7 +937,7 @@ - + @@ -917,10 +950,13 @@ - - .  - - + + + + .  + + +

@@ -937,7 +973,9 @@ - + + + @@ -967,9 +1005,9 @@ - - - + + +
@@ -1813,7 +1851,9 @@ -

Module

+ + Module +
@@ -1825,7 +1865,9 @@ -

Module Summary

+ + Module Summary +
@@ -1836,7 +1878,9 @@ -

C Library

+ + C Library +
@@ -1848,7 +1892,9 @@ -

Library Summary

+ + Library Summary +
@@ -1859,7 +1905,9 @@ -

Command

+ + Command +
@@ -1871,7 +1919,9 @@ -

Command Summary

+ + Command Summary +
@@ -1882,7 +1932,9 @@ -

File

+ + File +
@@ -1894,7 +1946,9 @@ -

File Summary

+ + File Summary +
@@ -1906,7 +1960,9 @@ -

Application

+ + Application +
@@ -1918,7 +1974,9 @@ -

Application Summary

+ + Application Summary +
@@ -1929,7 +1987,9 @@ -

Description

+ + Description +

@@ -1943,7 +2003,9 @@ -

Exports

+ + Exports +
@@ -1960,7 +2022,8 @@

+ mode="types"/> +

@@ -2019,14 +2082,19 @@ - - - - - - - -
+ + + + + + + + + + + + +
@@ -2047,15 +2115,29 @@ -
+
+ + + + + + +
-
+
+ + + + + + +
- +
@@ -2115,6 +2197,49 @@
+ + +

+ + + + +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3