GithubHelp home page GithubHelp logo

ririio-ssg's Introduction

About The Project

The project allows for the conversion of .txt and .md files to a formatted HTML5

Getting Started

  1. Open the consolde and install the package by typing npm install ririio-ssg
  2. Create a connection between the package and your current project folder by typing npm link ririio-ssg
  3. Create a file on your main directory called .env, this is used to store value of your output folder and current language
  4. Inside .env paste this line of code OUTPUT_DIRECTORY="dist" followed by HTML_LANGUAGE="en-CA" on the line beneath

Commands

Command Name Command Line Description Command Structure
Input (--input, -I) This command will allow the user to be able to convert a .txt or .md file to that of an HTML5. my-ssg --input [fileName/directoryName]
Config (--config, -C) This command will allow the user to be able to pass a .json file with supported configuration keys such as input, output, and lang. The command will then be able to convert .txt or .md files specified in the input property to that of an HTML5. The output directory by default is dist, but if output key is defined in config file, the command will replace the default directory with the value of output key my-ssg --config [fileName]
Output (--output, -O) This command will allow the user to change to create their own default folder for all the HTML5 that they convert my-ssg --output [directoryName]
Help (--help, -H) This command will display the description of the program and all its available command and their respective descriptions my-ssg --help
Version (--version, -V) This command displays the current version of the program my-ssg --version

Roadmap

  • Add Input Command
  • Add Output Command
  • Add Stylize Command
  • Allow for multi-level directory conversion
  • Generate an index.js which contains all links to the HTML files within a directory
  • Stylized each Generated HTML page
  • Add Language Command

Contact


Contributor(s): Mario Leonardo - [email protected]

ririio-ssg's People

Contributors

ririio avatar serpentbytes avatar denke8 avatar

Watchers

 avatar

ririio-ssg's Issues

Feature request: add configuration support

Feature Request

I have noticed that ririio-ssg lacks support parsing config files in .json format. I would like to contribute to your project so it can successfully accept and process a valid JSON config file.

Please assign this issue to me.

Add and use prettier

The professor's notes talk about adding prettier into the project. This is really helpful, and will help you format (making the code formatting completely consistent) the code for you.

You should also commit the lockfile

When you install a dependency, the package.json file usually have it with a ^ in front of the version.

This means, that you say that "I want at least this version, but during an upgrade you can go with the latest one that has the same major" (the first number)

If you don't submit the lockfile, either package.lock.json or yarn.lock this will always happen not only during an upgrade. This can cause unforseen and hard to debug problems, if one of the dependencies come out with a new bug or they don't properly follow semver.

Committing the lockfile, and manually upgrading gives you much more control over the process.

Code should be moved out of the "release 0.1" folder

In a normal project, there are multiple releases, as you develop the code.

You will not want to rename this folder at each go, because it will make the changes (git diff) very hard to follow (all file's paths will change)

If you really want. you can tag each release using the git tag and later git push --tags commands in the git tree itself

Add Lang Flag for the code

It's best to allow the user to allow what type of language they want the html file to be in. Thus, I'm adding a flag to allow for this

Line endings can contain `\r` too

In unix / linux machines, you'r code would work perfectly, because they use \n only to indicate the end of a line in a text file

However, in Windows, you'll have \r\n (AKA. CR+LF or CRLF). This is the reason you neet the trim a few lines later I guess.

I advise you that in the split command you use a refex, that can handle both formats, like: .split(/\r?\n/).
This will break the string in all \n (LF), but will also remove \r (CR) characters too, making your job a bit easier down the line

Configuration Support

I intend to add to this project the feature to include an optional JSON file specifying a lot of the parameters that would effect the behavior of the site generator. To begin perhaps simply specifying input and output files. Something like the following:

{
  "input": "./docs",
  "output": "./web"
}

Licenses mismatch

The license file is of apache 2.0, but package.json states that license is ISC. These should be the same

Drop the `express` dependency.

This is a static site generator, command line util.

Express is for serving content over a network connection.
In this project it's not needed, and also as far as I can see, you don't use it at all

Add markdown features to the code

Like we talked about, I plan to add MD features to your project.

I plan to:

  • alter the project structure a bit and move text parsing and processing into it's own file
  • make it so, that there is a distinct element: "block", because we'll need to search for markdown within a block
  • Use Regexes to find and process the specific markdown features

avoid the use of var

In a modern JS codebase we try hard to avoid the use of var.

If the content of the variable will be changed, use let, if not, use const.

If you set up your eslint correctly, it will notify you of these things right in vscode, and it will suggest fixes too

eslint and prettier can really help a lot!

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.