Skip to content
This repository was archived by the owner on Feb 20, 2019. It is now read-only.

Adding md documentation (for static doc generation) to repo #189

Open
wants to merge 5 commits into
base: 0.9.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,19 @@ Known limitations:
3. Picklers are generated directly at call sites, since we cannot have introduceTopLevel in 2.10.x.
4. No runtime compilation, since it's not obvious how to package it without inducing a dependency on `scala-compiler.jar`.
-->

## Contributing

### Building

Scala/pickling uses sbt. So, just make sure you've got [sbt installed](http://www.scala-sbt.org/0.13/tutorial/Setup.html), `cd` into the root directory of pickling, and simply type `sbt` at the command line.

To build Scala/pickling, from the sbt prompt, just type `compile`.

To run the Scala/pickling test suite, from the sbt prompt, just type `test`.

If you want to add documentation, our overview-style docs are located in the `docs/` directory. We use [mkdocs](http://www.mkdocs.org/), a tool for taking hierarchies of documentation written in markdown, and generating a static set of docs. To install `mkdocs`, you need python and pip, the python package manager. Installation is one line, `pip install mkdocs`. _Note: if pip fails, try installing version 1.2.1 of pip by doing `sudo easy_install pip==1.2.1`)_.

To preview the docs on a local web server, just run `mkdocs serve` from the root directory of pickling and visit http://localhost:8000.

To generate a directory of the static HTML, just run `mkdocs build`. The static HTML will be located in `/site`.
20 changes: 20 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<p>&nbsp;</p>
<!-- <p>&nbsp;</p> -->

Scala/pickling is an automatic serialization framework for Scala. It's fast,
boilerplate-free, and allows users to easily swap in/out different
serialization formats (such as binary, or JSON), or even to provide your own
custom serialization format.

**Basic usage:**
~~~scala
import scala.pickling._
import json._

val pckl = List(1, 2, 3, 4).pickle
val lst = pckl.unpickle[List[Int]]
~~~

# Getting Started

## Installation
60 changes: 60 additions & 0 deletions docs/theme/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% if page_description %}<meta name="description" content="{{ page_description }}">{% endif %}
{% if site_author %}<meta name="author" content="{{ site_author }}">{% endif %}
{% if canonical_url %}<link rel="canonical" href="{{ canonical_url }}">{% endif %}
{% if favicon %}<link rel="shortcut icon" href="{{ favicon }}">
{% else %}<link rel="shortcut icon" href="{{ base_url }}/img/favicon.ico">{% endif %}

<title>{{ page_title }}</title>

<link href="{{ base_url }}/css/bootstrap-custom.min.css" rel="stylesheet">
<link href="{{ base_url }}/css/font-awesome-4.0.3.css" rel="stylesheet">
<link href="{{ base_url }}/css/prettify-1.0.css" rel="stylesheet">
<link href="{{ base_url }}/css/base.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->

{% if config.theme_center_lead %}
<style>
div.col-md-9 h1:first-of-type {
text-align: center;
font-size: 60px;
font-weight: 300;
}

div.col-md-9 p:first-of-type {
text-align: center;
}
</style>
{% endif %}
</head>

<body>

{% include "nav.html" %}

<div class="container">
<div class="col-md-3">{% include "toc.html" %}</div>
<div class="col-md-9" role="main">{% include "content.html" %}</div>
</div>

{% if include_search %}{% include "search.html" %}{% endif %}

<script src="{{ base_url }}/js/jquery-1.10.2.min.js"></script>
<script src="{{ base_url }}/js/bootstrap-3.0.3.min.js"></script>
<script src="{{ base_url }}/js/prettify-1.0.min.js"></script>
<script src="{{ base_url }}/js/retina.min.js"></script>
<script src="//use.typekit.net/dwf8mie.js"></script>
<script>try{Typekit.load();}catch(e){}</script>
<script src="{{ base_url }}/js/base.js"></script>
</body>
</html>
9 changes: 9 additions & 0 deletions docs/theme/content.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{% if meta.source %}
<div class="source-links">
{% for filename in meta.source %}
<span class="label label-primary">{{ filename }}</span>
{% endfor %}
</div>
{% endif %}

{{ content }}
113 changes: 113 additions & 0 deletions docs/theme/css/base.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
body {
padding-top: 70px;
}

ul.nav li.main {
font-weight: bold;
}

div.col-md-3 {
padding-left: 0;
}

div.source-links {
float: right;
}

/*
* Side navigation
*
* Scrollspy and affixed enhanced navigation to highlight sections and secondary
* sections of docs content.
*/

/* By default it's not affixed in mobile views, so undo that */
.bs-sidebar.affix {
position: static;
}

.bs-sidebar.well {
padding: 0;
}

/* First level of nav */
.bs-sidenav {
margin-top: 30px;
margin-bottom: 30px;
padding-top: 10px;
padding-bottom: 10px;
border-radius: 5px;
}

/* All levels of nav */
.bs-sidebar .nav > li > a {
display: block;
padding: 5px 20px;
}
.bs-sidebar .nav > li > a:hover,
.bs-sidebar .nav > li > a:focus {
text-decoration: none;
border-right: 1px solid;
}
.bs-sidebar .nav > .active > a,
.bs-sidebar .nav > .active:hover > a,
.bs-sidebar .nav > .active:focus > a {
font-weight: bold;
background-color: transparent;
border-right: 1px solid;
}

/* Nav: second level (shown on .active) */
.bs-sidebar .nav .nav {
display: none; /* Hide by default, but at >768px, show it */
margin-bottom: 8px;
}
.bs-sidebar .nav .nav > li > a {
padding-top: 3px;
padding-bottom: 3px;
padding-left: 30px;
font-size: 90%;
}

/* Show and affix the side nav when space allows it */
@media (min-width: 992px) {
.bs-sidebar .nav > .active > ul {
display: block;
}
/* Widen the fixed sidebar */
.bs-sidebar.affix,
.bs-sidebar.affix-bottom {
width: 213px;
}
.bs-sidebar.affix {
position: fixed; /* Undo the static from mobile first approach */
top: 80px;
}
.bs-sidebar.affix-bottom {
position: absolute; /* Undo the static from mobile first approach */
}
.bs-sidebar.affix-bottom .bs-sidenav,
.bs-sidebar.affix .bs-sidenav {
margin-top: 0;
margin-bottom: 0;
}
}
@media (min-width: 1200px) {
/* Widen the fixed sidebar again */
.bs-sidebar.affix-bottom,
.bs-sidebar.affix {
width: 263px;
}
}

.github-stars {
margin-top: 26px;
}

.version-number {
font-family: "museo-slab",serif;
font-style: normal;
font-weight: 300;
color: #586E75;
font-size: 16px;
}
1 change: 1 addition & 0 deletions docs/theme/css/bootstrap-custom.min.css

Large diffs are not rendered by default.

Loading