An open API service indexing awesome lists of open source software.

https://github.com/app-generator/html-parser

Html Parser - Html to Pug, Jinja2, Blade Converter | AppSeed
https://github.com/app-generator/html-parser

appseed developer-tools html-parser open-source pug

Last synced: 3 months ago
JSON representation

Html Parser - Html to Pug, Jinja2, Blade Converter | AppSeed

Awesome Lists containing this project

README

        

# [HTML parser](https://appseed.us/developer-tools/html-parser)

Interactive tool to convert flat HTML (themes or stand-alone files) to Pug, Jinja2 and Blade templates.


## What is an HTML Parser

According to Wikipedia, Parsing or syntactic analysis is the process of analyzing a string of symbols, either in natural language or in computer languages, according to the rules of a formal grammar. The meaning of HTML parsing applied here consist into load the HTML, extract and process the relevant information like head title, page assets, main sections and later on, save the processed file.


## Tool Features

The goal of this tool is to automate the UI integration into existing apps, written in different technologies and frameworks. Starting from flat HTML, the tool can be used by anyone to extract components, edit attributes and traverse the HTML tree using an interactive console.


## Use-cases

- normalize the HTML file to load the assets from a standard directories ( /assets/ [ img, js, css ] ) making the integration in webpack related tools much easier
- edit / traverse the HTML tree
- edit attributes like anchor href's, span texts, remove elements, edit class names
- extract components for production use for various engines like PUG, Jinja2, Blade
- migrate legacy Bootstrap layouts to Bulma and Tailwind CSS frameworks


## HTML Parser Work-flow

### Load the HTML theme / page

![HTML Parser - Load the HTML theme.](https://github.com/app-generator/static/blob/master/developer-tools/html-parser-select-theme.jpg?raw=true)

![HTML Parser - Select the HTML page.](https://github.com/app-generator/static/blob/master/developer-tools/html-parser-select-file.jpg?raw=true)


### Select Components

![HTML Parser - Select components.](https://github.com/app-generator/static/blob/master/developer-tools/html-parser-select-component.jpg?raw=true)


### Edit Elements

![HTML Parser - Edit elements.](https://github.com/app-generator/static/blob/master/developer-tools/html-parser-component-table-view.jpg)

![HTML Parser - Edit elements.](https://github.com/app-generator/static/blob/master/developer-tools/html-parser-component-print-view.jpg?raw=true)


## Real life sample

The sample, extracted from [Stellar HTML5Up theme](https://github.com/app-generator/html-parser/tree/master/sample-stellar) is a simple navigation bar, extracted from [this file](https://github.com/app-generator/html-parser/blob/master/sample-stellar/index.html)

- Index file: [original version](https://github.com/app-generator/html-parser/blob/master/sample-stellar/index.html) and [normalized version](https://github.com/app-generator/html-parser/blob/master/sample-stellar/index2.html)
- [JSON descriptor](https://github.com/app-generator/html-parser/blob/master/sample-stellar/index2.json) is generated by the **HTML parser** tool and encapsulate the assets and resources used by the HTML files
- Navigation component
- [HTML version](https://github.com/app-generator/html-parser/blob/master/sample-stellar/components/nav.html)
- [PUG version](https://github.com/app-generator/html-parser/blob/master/sample-stellar/components/nav.pug)
- [Jinja2 Version](https://github.com/app-generator/html-parser/blob/master/sample-stellar/components/nav.j2)
- [Php version](https://github.com/app-generator/html-parser/blob/master/sample-stellar/components/nav.php)
- [JSON descriptor](https://github.com/app-generator/html-parser/blob/master/sample-stellar/components/nav.json)

### Pug version

```yaml
nav#nav
ul
li
a.active.newclass(href='https://appseed.us/html-parser').

Introduction

li
a(href='#first').

First Section

li
a(href='#second').

Second Section

li
a(href='#cta').

Get Started
```


### PHP version

```php

```


## Projects built with this tool

All are open-source, with live DEMO.
- [JAMstack Fractal](https://github.com/app-generator/jamstack-fractal) - HTML5Up design coded in JAMstack pattern
- [JAMstack BigPicture](https://github.com/app-generator/jamstack-big-picture) - HTML5Up design coded in JAMstack pattern
- [JAMstack Landed](https://github.com/app-generator/jamstack-landed) - HTML5Up Landed design coded in JAMstack pattern
- [Flask Dashboard Material Design](https://github.com/app-generator/flask-material-dashboard) - Admin Dashboard with Material Design
- [Flask Dashboard NowUI](https://github.com/app-generator/flask-now-ui-dashboard) - Admin Dashboard with NowUI Design
- [Flask Dashboard Black](https://github.com/app-generator/flask-black-dashboard) - Open-Source Admin Panel
- [Flask Dashboard Argon](https://github.com/app-generator/flask-argon-dashboard) - Open-Source Admin Panel
- [Flask Dashboard Light](https://github.com/app-generator/flask-dashboard-light-bootstrap) - Open-Source Admin Panel


## License & Usage

**The tool is not open-source**. For licenses, please contact [AppSeed](https://appseed.us/?ref=html-parser) - **support [ @ ] appseed.us**


---
[HTML parser](https://appseed.us/developer-tools/html-parser) **tool** provided by **AppSeed**