Merge lp:~marcoceppi/juju-core/docs-makefile into lp:juju-core/docs

Proposed by Marco Ceppi
Status: Work in progress
Proposed branch: lp:~marcoceppi/juju-core/docs-makefile
Merge into: lp:juju-core/docs
Diff against target: 51 lines (+18/-11)
2 files modified
Makefile (+12/-0)
htmldocs/contributing.html (+6/-11)
To merge this branch: bzr merge lp:~marcoceppi/juju-core/docs-makefile
Reviewer Review Type Date Requested Status
Nick Veitch (community) Needs Fixing
Review via email: mp+201908@code.launchpad.net

Description of the change

Add makefile with a few convient targets

To post a comment you must log in.
217. By Marco Ceppi

Add lint target

Revision history for this message
Nick Veitch (evilnick) wrote :

Hi,

When we discussed this before we said we didn't want a Makefile in the root - it just confuses people who think they need to run it to "build" the docs.
I don't mind something going in the tools directory, but then isn't it just easier to have a simple script to run a webserver/browser?

Also, you need to run the server from within the htmldocs directory or lots of stuff doesn't work :P

review: Needs Fixing
Revision history for this message
Marco Ceppi (marcoceppi) wrote :

That's actually not true about about the htmldocs directory, I removed a lot of the deps so it'll work from outside of the directory.

I don't see the problem with a Makefile, not many people contribute and those who do can easily see the Makefile doesn't have much in it, but I leave that up to your discretion.

Revision history for this message
John A Meinel (jameinel) wrote :

I thought we moved all this stuff to github.com/juju/docs, is that true? For now, marking this WiP

Unmerged revisions

217. By Marco Ceppi

Add lint target

216. By Marco Ceppi

Making it easier to spin up server

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'Makefile'
2--- Makefile 1970-01-01 00:00:00 +0000
3+++ Makefile 2014-01-16 11:16:25 +0000
4@@ -0,0 +1,12 @@
5+PORT ?= 8000
6+
7+server:
8+ - @python -m SimpleHTTPServer ${PORT} 2>/dev/null
9+
10+browser:
11+ @xdg-open 'http://localhost:${PORT}/htmldocs/getting-started.html'
12+
13+lint:
14+ @python tools/lint.py
15+
16+test: browser server
17
18=== modified file 'htmldocs/contributing.html'
19--- htmldocs/contributing.html 2013-12-16 14:54:13 +0000
20+++ htmldocs/contributing.html 2014-01-16 11:16:25 +0000
21@@ -21,12 +21,6 @@
22 </head>
23 <!--End-Head-->
24
25-
26-
27-
28-
29-
30-
31 <body class="resources">
32
33 <!--Header-->
34@@ -118,11 +112,12 @@
35
36 <h1>Testing or Deploying locally</h1>
37 <p>The documentation makes use of Javascript for some functionality, so in order to test the docs properly or serve them localy, you will need to have an http server set up.</p>
38- <p>On Ubuntu this is easy. Install (if you need to) and start the apache2 web server, then just copy the htmnldocs directory to a convenient location - </p>
39- <pre class="prettyprint">sudo cp -R htmldocs /var/www/htmldocs</pre>
40- <p>You can then point your web browser at your local machine (127.0.0.1/htmldocs) to view the files.</p>
41- <p>Alternatively, you can use Python to start a simple HTTP server on the docs directory. Navigate to the htmldocs directory of juju-core docs and run the following:</p>
42- <pre class="prettyprint">python -m SimpleHTTPServer</pre>
43+ <p>You can enable a server by running</p>
44+ <pre class="prettyprint">make server</pre>
45+ <p>From the root of the repository. In addition to <code>make server</code> you can run:</p>
46+ <pre class="prettyprint"> make test</pre>
47+ <p>Which will start the server and open your browser window to the newly created server. In the event you get a port conflict, you can override the port used by setting the <code>PORT</code> env variable:
48+ <pre class="prettyprint">PORT=8080 make test</pre>
49
50 <h2>Submitting your work</h2>
51 <p>We love it when the community contributes to documentation, here's how to get the code, branch it, modify it, and submit it back. First off get the code:</p>

Subscribers

People subscribed via source and target branches