Giter VIP home page Giter VIP logo

manner's Introduction

manner

Convert troff man pages to semantic HTML.

This is used for rendering pages on ManKier.

Macro conversion:

Example

See in the examples folder:

.TH EXAMPLE "1" "June 2024" "manner" "Example Man Page"

.SH NAME
example \- sample man page

.SH SYNOPSIS
.B example
[\fI\,OPTION\/\fR]...

.SH DESCRIPTION
.\" This is a comment
.PP
Not a real command or man page!
.TP
\fB\-a\fR, \fB\-\-all\fR
a sample option
.TP
\fB\-b\fR, \fB\-\-ball\fR
another sample option
.PP

.TS
tab(@);
l l.
T{
Column 1
T}@T{
Column 2
T}
_
T{
row1
T}@T{
This is some tabular date
T}
T{
this is the second row
T}@T{
translated to an HTML <table>
T}
.TE


.SH SEE ALSO
.IP \(bu
First thing to see:
.UR https://example.com/something
Some Project
.UE .
.IP \(bu
Second thing to see.

.SH AUTHORS
This was written by
.MT [email protected]
Author 1
.ME
and
.MT [email protected]
Author 2
.ME .

After running:

./manner.php example.1 > example.html

... the output is compact, but reformatting with Prettier to show the structure of the output gives:

<!doctype html>
<meta charset="utf-8" />
<meta
  name="man-page-info"
  data-extra1="June 2024"
  data-extra2="manner"
  data-extra3="Example Man Page"
/>
<title>EXAMPLE</title>
<body>
  <h1>EXAMPLE</h1>
  <section>
    <h2>NAME</h2>
    <p>example - sample man page</p>
  </section>
  <section>
    <h2>SYNOPSIS</h2>
    <p><strong>example</strong> [<em>OPTION</em>]...</p>
  </section>
  <section>
    <h2>DESCRIPTION</h2>
    <p>Not a real command or man page!</p>
    <dl>
      <dt><strong>-a</strong>, <strong>--all</strong></dt>
      <dd><p>a sample option</p></dd>
      <dt><strong>-b</strong>, <strong>--ball</strong></dt>
      <dd><p>another sample option</p></dd>
    </dl>
    <table>
      <tr class="border-bottom">
        <td>Column 1</td>
        <td>Column 2</td>
      </tr>
      <tr>
        <td>row1</td>
        <td>This is some tabular date</td>
      </tr>
      <tr>
        <td>this is the second row</td>
        <td>translated to an HTML &lt;table&gt;</td>
      </tr>
    </table>
  </section>
  <section>
    <h2>SEE ALSO</h2>
    <ul>
      <li class="p">
        First thing to see:
        <a href="https://example.com/something">Some Project</a>.
      </li>
      <li class="p">Second thing to see.</li>
    </ul>
  </section>
  <section>
    <h2>AUTHORS</h2>
    <p>
      This was written by <a href="mailto:[email protected]">Author 1</a> and
      <a href="mailto:[email protected]">Author 2</a>.
    </p>
  </section>
</body>

Requirements

  • PHP >= 8.2
  • A few man pages contain .EQ macros, for these the eqn command is required.
  • A few man pages contain .PS macros, for these the pic2plot and inkscape commands are required.

manner's People

Contributors

jacksonp avatar

Stargazers

 avatar Sebastian Carlos avatar

Watchers

 avatar

manner's Issues

Collision when cloning on case-insensitive file systems

Hey there. This is a tiny issue, just pointing it out in case it matters to you. Cheers!

warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:

  'tests/URL.1'
  'tests/url.1'
  'tests/URL.1.html'
  'tests/url.1.html'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.