Browse Source

EDoc overview page and custom CSS

Viktor Söderqvist 10 years ago
parent
commit
e2e7e66375
4 changed files with 232 additions and 0 deletions
  1. 4 0
      .gitignore
  2. 97 0
      doc/overview.edoc
  3. 130 0
      doc/style.css
  4. 1 0
      rebar.config

+ 4 - 0
.gitignore

@@ -3,6 +3,10 @@ deps
 *.o
 *.o
 *.beam
 *.beam
 *.plt
 *.plt
+doc/*.html
+doc/edoc-info
+doc/erlang.png
+doc/stylesheet.css
 erl_crash.dump
 erl_crash.dump
 ebin
 ebin
 rel/example_project
 rel/example_project

+ 97 - 0
doc/overview.edoc

@@ -0,0 +1,97 @@
+%% MySQL/OTP – a MySQL driver for Erlang/OTP
+%% Copyright (C) 2014 Viktor Söderqvist
+%%
+%% This program is free software: you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by
+%% the Free Software Foundation, either version 3 of the License, or
+%% (at your option) any later version.
+%%
+%% This program is distributed in the hope that it will be useful,
+%% but WITHOUT ANY WARRANTY; without even the implied warranty of
+%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+%% GNU General Public License for more details.
+%%
+%% You should have received a copy of the GNU General Public License
+%% along with this program. If not, see <https://www.gnu.org/licenses/>.
+------------------------------------------------------------------------
+
+@title MySQL/OTP client library
+@doc
+This is the documentation generated from the Erlang source code using EDoc.
+
+The source code is available on the github page <a target="_top"
+ href="https://github.com/mysql-otp/mysql-otp/">
+https://github.com/mysql-otp/mysql-otp/</a> along with a wiki and an issue
+tracker.
+
+This documentation is free to to copy, change and use for any purpose in
+accordance with the GNU GPL 3 or any later version as it is generated from the
+the source code itself which has this license. See the LICENSE file in the
+source code.
+
+<h2>API functions</h2>
+
+The <a href="mysql.html">mysql</a> module contains all the API
+functions for connecting to and interacting with a MySQL server.
+The <a href="mysql_connection.html">mysql_connection</a> module is the
+`gen_server' callback module holding a connection so you may want to refer to
+that sometimes (e.g. in the Modules part in a childspec for a supervisor). The
+other modules are for the internals.
+
+<h2>Value representation</h2>
+
+<table>
+  <thead>
+    <tr>
+      <th>MySQL</th>
+      <th>Erlang</th>
+      <th>Example</th>
+    </tr>
+  </thead>
+  <tbody>
+    <tr>
+      <td>INT, TINYINT, etc.</td>
+      <td>`integer()'</td>
+      <td>`42'</td>
+    </tr>
+    <tr>
+      <td>VARCHAR, TEXT, etc.</td>
+      <td>`iodata()'</td>
+      <td>`<<"foo">>, "bar"'</td>
+    </tr>
+    <tr>
+      <td>FLOAT, DOUBLE</td>
+      <td>`float()'</td>
+      <td>`3.14'</td>
+    </tr>
+    <tr>
+      <td>DECIMAL</td>
+      <td>`binary()'</td>
+      <td>`<<"3.140">>'</td>
+    </tr>
+    <tr>
+      <td>DATETIME, TIMESTAMP</td>
+      <td>`calendar:datetime()'</td>
+      <td>`{{2014, 11, 18}, {10, 22, 36}}'</td>
+    </tr>
+    <tr>
+      <td>DATE</td>
+      <td>`calendar:date()'</td>
+      <td>`{2014, 11, 18}'</td>
+    </tr>
+    <tr>
+      <td>TIME</td>
+      <td>`{Days, calendar:time()}'</td>
+      <td>`{0, {10, 22, 36}}'</td>
+    </tr>
+    <tr>
+      <td>NULL</td>
+      <td>`null'</td>
+      <td>`null'</td>
+    </tr>
+  </tbody>
+</table>
+
+<h2>Example with Poolboy</h2>
+
+TODO

+ 130 - 0
doc/style.css

@@ -0,0 +1,130 @@
+/* Customized EDoc style sheet */
+* {
+    box-sizing: border-box;
+}
+body {
+    font: 16px/1.6 "Helvetica Neue",Helvetica,"Segoe UI",Arial,freesans,sans-serif;
+    color: #333;
+    padding: 30px;
+    background-color: #ffffff;
+    font-size:1.0em;
+}
+body > :first-child {
+    margin-top: 0 !important;
+}
+h1, h2, h3, h4, h5, h6 {
+    position: relative;
+    margin-top: 1em;
+    margin-bottom: 16px;
+    font-weight: bold;
+    line-height: 1.4;
+}
+h1 {
+    margin-top: 1em;
+    padding-bottom: 0.3em;
+    font-size: 2.25em;
+    line-height: 1.2;
+    border-bottom: 1px solid #EEE;
+}
+h2 {
+    padding-bottom: 0.3em;
+    font-size: 1.75em;
+    line-height: 1.225;
+    border-bottom: 1px solid #EEE;
+}
+h3 {
+    font-size: 1.5em;
+    line-height: 1.43;
+}
+div.navbar {
+    padding: 0.2em 0.3em 0.2em 1em;
+    margin: 1em 0;
+    border: solid 1px #ddd;
+    background-color: #f5f5f5;
+    border-radius: 3px;
+}
+h2.indextitle {
+    margin-top: 0;
+    margin-left: -20px;
+    margin-right: -20px;
+}
+h3.function, h3.typedecl {
+    font-family: Consolas,"Liberation Mono",Menlo,Courier,monospace;
+    font-size: 1.1em;
+}
+div.spec {
+    padding: 5px;
+    background-color: #eee;
+    border-radius: 3px;
+}
+div.spec p {
+    margin: 0
+}
+a:link, a:visited {
+    color: #4183C4;
+    text-decoration: none;
+}
+a:hover {
+    text-decoration: underline;
+}
+h2 a, h3 a, h4 a, h5 a, h6 a {
+    color: #333;
+    text-decoration: none !important;
+}
+a.module,a.package {
+    text-decoration:none
+}
+a.module:hover,a.package:hover {
+    background-color: #eeeeee;
+}
+ul.definitions {
+    list-style-type: none;
+}
+ul.index {
+    /*list-style-type: none;
+    background-color: #eeeeee;*/
+}
+hr {
+    display: none;
+}
+table tr:nth-child(2n) {
+    background-color: #fafafa;
+}
+table th, table td {
+    padding: 6px 13px;
+    border: 1px solid #ddd;
+}
+table[border="0"] td {
+    /* design elements in footer etc */
+    padding: 0;
+    border: none;
+}
+table[border="0"] tr {
+    background-color: transparent;
+}
+table[summary="list of modules"] {
+    margin: 0 -20px;
+}
+table[summary="list of modules"] td {
+    border: none;
+    padding: 2px 0;
+}
+
+ul {
+    /*list-style-type: square;*/
+}
+table {
+    border-collapse: collapse;
+}
+td {
+    padding: 3px
+}
+code, tt {
+    font: 12px Consolas,"Liberation Mono",Menlo,Courier,monospace;
+    padding: 0.2em 0px;
+    margin: 0;
+    font-size: 85%;
+    background-color: #eee;
+    border-radius: 3px;
+    text-shadow: 1px 1px 0 #fff;
+}

+ 1 - 0
rebar.config

@@ -1 +1,2 @@
 {cover_enabled, true}.
 {cover_enabled, true}.
+{edoc_opts, [{stylesheet_file, "doc/style.css"}, {todo, true}]}.