GithubHelp home page GithubHelp logo

gmi2html's People

Contributors

bratishkaerik avatar der-teufel-programming avatar eggplants avatar shtanton avatar sikmir avatar techboyg5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gmi2html's Issues

Write some tests

Should have some test input and outputs.
Probably use the gemini stress tests for this.

gmi2html core dumped

$ zig version
0.9.1
$ gmi2html -h
fish: Job 1, 'gmi2html -h' terminated by signal SIGILL (Illegal instruction)
$ coredumpctl gdb
(gdb) bt
#0  0x000000000023a2f4 in memset ()
#1  0x0000000000208923 in std.os.linux.tls.initTLS ()
#2  0x00000000002074a4 in std.os.linux.tls.initStaticTLS ()
#3  0x0000000000206a50 in std.start.posixCallMainAndExit ()
#4  0x0000000000206883 in _start ()

Make translation more semantic

The use of <br/> everywhere isn't a very semantic use, and almost all can be removed:

  • text should translate to <p>text</p>
  • Empty lines should translate to <p><br/></p>
  • Inline elements that must be on a line by themselves (such as <a>) should translate to <a style="display: block;">content</a>

Inspired by https://codeberg.org/talon/gmi-web

error: member function expected 0 argument(s) when building

I clone the project on thet latest version on master branch (84cfa53)
zig version : 0.10.1
I'm on archlinux x86_64 Linux 6.2.12-arch1-1

The error :

/home/david/src/gmi2html/src/main.zig:208:16: error: member function expected 0 argument(s), found 1
    while (args.next(allocator)) |maybeArg| {
           ~~~~^~~~~
/usr/lib/zig/std/process.zig:777:9: note: function declared here
    pub fn next(self: *ArgIterator) ?([:0]const u8) {
    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
    callMain: /usr/lib/zig/std/start.zig:614:32
    initEventLoopAndCallMain: /usr/lib/zig/std/start.zig:548:51
    remaining reference traces hidden; use '-freference-trace' to see all reference traces

error: gmi2html...
error: The following command exited with error code 1:
/usr/bin/zig build-exe /home/david/src/gmi2html/src/main.zig -fno-strip --cache-dir /home/david/src/gmi2html/zig-cache --global-cache-dir /home/david/.cache/zig --name gmi2html -fsingle-threaded --enable-cache
error: the following build command failed with exit code 1:

Improve error handling

Some errors that probably should be handled:

  • file not found
  • file is dir
  • access denied
  • unrecognized argument

-h and -v flags

  • -h should show help, which should also be shown if no input is given
  • -v should show the version

Flag to replace gemini:// urls with something usable on the web

A web page probably isn't that useful if all the links point to places inaccessible from a web browser.
Ideas:

  • Provide a domain to the flag and urls matching that domain become https e.g. gemini://thing.com => https://thing.com. This works if the whole gemini site is mirrored on the the web
  • Link to a gemini web portal. This works all the time but isn't great if the site is mirrored on the web, people will be viewing pages through a portal they could just be seeing on the web.
  • Users just pipe the gemtext through awk or something before gmi2html allowing them to do whatever works best but making their life slightly harder

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.