Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emaringolo/seaside-converter
Proof of concept of an HTML to Seaside code converter
https://github.com/emaringolo/seaside-converter
Last synced: 16 days ago
JSON representation
Proof of concept of an HTML to Seaside code converter
- Host: GitHub
- URL: https://github.com/emaringolo/seaside-converter
- Owner: eMaringolo
- Created: 2017-05-27T03:57:21.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-30T19:10:51.000Z (over 7 years ago)
- Last Synced: 2024-10-09T13:25:11.181Z (about 1 month ago)
- Language: Smalltalk
- Size: 25.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Seaside Converter
Convert HTML code to Seaside canvas expressions.
E.g., the following HTML code
```
- Coffee
- Tea
- Milk
```
Will get converted to:
```
html
table
style: 'width:100%';
with: [ html
tableRow: [ html
tableData: [ html image
url: 'http://seaside.st/styles/logo-plain.png';
altText: 'Seaside logo';
yourself ].
html tableData
colSpan: '2';
rowSpan: '2';
with: [ html unorderedList
style: 'list-style-type:square';
with: [ html listItem: 'Coffee'.
html listItem: 'Tea'.
html listItem: 'Milk' ] ] ] ]
```
# How to use
Evaluate `WAHtmlConverter convert: htmlString` and it will return a string containing the Smalltalk code using Seaside methods.
Otherwise you can use the Seaside component `WAHtmlConverterComponent` that should be installed by default at your server in the `/converter` path.
For more details browse the `WAHtmlConverterTest` class.
# Future steps
* Make the converter tool more pretty and less error prone if the output is malformed
* Change the string based generation by a more object oriented one that could handle special canvas selectors like those used by Twitter Bootstrap or Material Design Lite.