Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5a00403
commit 6dda2bf
Showing
4 changed files
with
63 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,19 +1,20 @@ | |||
COMPILING THE NITROGEN DOCUMENTATION | COMPILING THE NITROGEN DOCUMENTATION | ||
|
|
||
|
|
||
Compiling the documentation uses Org-mode for Emacs. | compiling the documentation uses Org-mode for Emacs and a simple Perl script for adding Disqus comments. | ||
|
|
||
Editing the HTML is not recommended, as the org-mode compiler just overwrites all HTML anyway. | Editing the HTML is not recommended, as the org-mode compiler just overwrites all HTML anyway. Instead, edit the org-mode files found in doc/org-mode. | ||
|
|
||
Instead, edit the org-mode files found in doc/org-mode. | Make sure you have emacs installed, with htmlize (version 1.34 or later), erlang-mode, and org-mode installed. | ||
|
|||
Make sure you have emacs installed, with the htmlize[1] (version 1.34 or later), erlang-mode, and org-mode installed. | |||
|
|
||
On Ubuntu, these packages can all be installed with: | On Ubuntu, these packages can all be installed with: | ||
|
|
||
sudo apt-get install emacs erlang-mode org-mode emacs-goodies-el | sudo apt-get install emacs erlang-mode org-mode emacs-goodies-el | ||
|
|
||
|
|
||
Once this is done, you can compile the docs from the command line with: | Then you can compile the docs from the command line with | ||
|
|
||
$ make docs | $ make docs | ||
|
|||
|
|||
Also worth noting is that the Disqus comment injection script expects perl to be in the PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,40 @@ | |||
#!/usr/bin/perl | |||
|
|||
use strict; | |||
|
|||
|
|||
my $raw_inject = &read_file("disqus.html"); | |||
my @files = `find html/* | grep \\.html\$`; | |||
|
|||
for my $file (@files) { | |||
chomp($file); | |||
print "Injecting Disqus code into $file..."; | |||
my $to_inject = $raw_inject; | |||
$to_inject =~ s/<page-identifier>/$file/g; | |||
my $contents = &read_file($file); | |||
if($contents =~ /<div id="disqus_thread">/) { | |||
print "already done\n"; | |||
}else{ | |||
$contents =~ s!</div>[\s\n]*</body>!</div>$to_inject</body>!g; | |||
&write_file($file,$contents); | |||
print "done\n"; | |||
} | |||
} | |||
|
|||
sub write_file | |||
{ | |||
my ($filename,$contents) = @_; | |||
open my $fh, ">$filename" or die "error opening $filename: $!"; | |||
print $fh $contents; | |||
close $fh; | |||
} | |||
|
|||
|
|||
sub read_file | |||
{ | |||
my ($filename) = @_; | |||
open my $fh, "<$filename" or die "error opening $filename: $!"; | |||
my $contents = do { local $/; <$fh> }; | |||
close $fh; | |||
return $contents; | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,15 @@ | |||
<div id="disqus_thread"></div> | |||
<script type="text/javascript"> | |||
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ | |||
var disqus_shortname = 'nitrogenproject'; // required: replace example with your forum shortname | |||
var disqus_identifier = '<page-identifier>'; //This will be replaced with the path part of the url | |||
|
|||
/* * * DON'T EDIT BELOW THIS LINE * * */ | |||
(function() { | |||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; | |||
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; | |||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); | |||
})(); | |||
</script> | |||
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> | |||
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a> |