Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aaamendes/manochrome
Generate man-page-like web pages from POD files
https://github.com/aaamendes/manochrome
javascript man manpage perl perldoc pod pod2html pod2man
Last synced: about 1 month ago
JSON representation
Generate man-page-like web pages from POD files
- Host: GitHub
- URL: https://github.com/aaamendes/manochrome
- Owner: aaamendes
- License: gpl-3.0
- Created: 2024-01-11T13:01:46.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-08-18T14:13:36.000Z (4 months ago)
- Last Synced: 2024-10-13T22:22:38.076Z (2 months ago)
- Topics: javascript, man, manpage, perl, perldoc, pod, pod2html, pod2man
- Language: HTML
- Homepage: https://aaamendes.github.io/manochrome/
- Size: 356 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.pod
- License: LICENSE
Awesome Lists containing this project
README
=pod
=begin html
=end html
=head1 NAME
MANochrome
- CSS and Javascript for HTML generated by L.manopod2html
- Converts F<.pod> files to F<.html> files with MANochrome included.=head1 SYNOPSIS
B B<-t> theme [B<-i> input_file] B<-o> output_file [B<-f>]
=head1 DESCRIPTION
The goal is to present information in a man page like style with some
appeal to the eye. The I theme comes closest to that goal.
The I theme deviates a bit from the initially monochrome style while
still being simple and giving a pleasant reading experience. It's inspired
by L.While the intention is mainly to convert F<.pod> files, it is also possible to
convert man pages. For further information, please see the L<"EXAMPLES">
section.Nicely formatted F<.pod> files work best and look great.
=head2 MANochrome
A set of cascading stylesheets (themes) and some Javascript which is
explained in the following sections.=head3 Themes
can be included in the of an HTML file and will change the
look of the HTML page.
They can be used in any HTML file but are intended to be used with HTML
generated by L.Available themes are
light
dark
monk=head3 Javascript
is optional but must be inserted before the closing C tag.
=head3 class MANochrome
The parent class, it is not initialized.
=head3 class MANochrome_pod
creates a sidebar with a fixed index where a link to the corresponding
section is B when B through the page or when
B.
An Index must be present in the HTML for this to work. L
generates an index by default. Said index is an unordered list (C<
- >) with
the C C<"index">.
The class must be initialized with some
Javascript after F was included.
const manochrome = new MANochrome_pod();
=head3 options
When initializing with C an I object
can can be passed. This must be adjusted manually but is very easy.
Take a look at F, L<"manopod2html"> inserts the content of this
file inside a script tag below the closing body tag.
=over 4
=item B
A path or URL to the image.
=item B
An array of objects like:
"links": [
{
"url": "https://github.com/aaamendes/manochrome.git",
"html": " Repo"
},
{
"url": "https://perl.org",
"html": "perl.org"
},
{
"url": "https://perlmonks.org",
"html": "perlmonks.org"
}
]
=back
L<"manopod2html"> can do all of this for you.
=head2 manopod2html
This perl script uses C to generate HTML from a F<.pod> file.
If used without the B<-f> flag, it will create a directory
F with the structure
=encoding UTF-8
manochrome_build
+-- css
| \-- manochrome_dark.css
+-- index.html
\-- js
\-- manochrome.js
where is the theme chosen with the B<-t> flag and
is the output file name chosen with B<-o>.
=head3 OPTIONS
=over 4
=item B<-t>
Pass the name of a theme.
=item B<-i>
Pass the input file.
If this flag is ommitted, read from STDIN.
=item B<-o>
Pass the output file.
=item B<-f>
Build a single file with css and javascript included.
=back
=head1 EXAMPLES
=head2 Build from POD
Build C from C in the repository
L
manopod2html -i Readme.pod -o index.html -t dark -f
=head2 Build from MAN
The tool L can create F<.pod> files from man pages.
We use it in combination with manopod2html:
man man | rman -f POD | \
manopod2html -o man.html -t dark -f
=head2 manochrome options
Add this script to the bottom of your html before the closing body tag to
initialize C with options.
() => {
'use strict';
const options = {
/*
* Add a logo to top of the sidebar.
*/
"logo_path": "img/logo.png",
/*
* Add links to the "LINKS" section at the bottom of the sidebar.
* The "LINKS" section will only be created if this option is passed.
*/
"links": [
{
"url": "https://github.com/aaamendes/manochrome.git",
"html": "<img src=\"img/github-mark-white.svg\"> Repo"
},
{
"url": "https://perl.org",
"html": "perl.org"
},
{
"url": "https://perlmonks.org",
"html": "perlmonks.org"
}
]
};
const manochrome = (MANochrome.has_index_id()) ?
new MANochrome_pod(options) : false;
})();
=head1 INSTALLATION
Just type
make
to install and
make uninstall
to uninstall.
=head1 FILES
=over 4
=item F
=item F
=item F
=item F
=item F
=item F
=item F
=item F
=back
=head1 SEE ALSO
L,
L,
L,
L,
L
=head1 AUTHORS
L
L
=head1 COPYRIGHT
S>
MANochrome 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 .
=cut