Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/laszlokorte/renewex_converter
Converterter to turn adhoc structure of parsed renew files into a normalized structure.
https://github.com/laszlokorte/renewex_converter
Last synced: about 19 hours ago
JSON representation
Converterter to turn adhoc structure of parsed renew files into a normalized structure.
- Host: GitHub
- URL: https://github.com/laszlokorte/renewex_converter
- Owner: laszlokorte
- Created: 2024-09-17T15:00:32.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-29T14:44:20.000Z (about 1 month ago)
- Last Synced: 2024-09-30T05:22:12.481Z (about 1 month ago)
- Language: Elixir
- Size: 1.43 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RenewEx Converter
![RenewEx](./guides/images/logo.png)
[Renew](http://renew.de/) file converter to turn files parsed with [RenewEx](https://hexdocs.pm/renewex/) ([Repository](https://github.com/laszlokorte/renewex/)) into a canonical structure that can be worked with more easily (for example be imported into a database).
[![Hex.pm](https://img.shields.io/hexpm/v/renewex_converter.svg)](https://hex.pm/packages/renewex_converter) [![Documentation](https://img.shields.io/badge/documentation-gray)](https://hexdocs.pm/renewex_converter/)
---
## Test cases
The conveter is tested [on more than 1000 example files.](https://github.com/laszlokorte/renewex_converter/tree/main/test/fixtures/valid_files)
### Running tests
All test:
```sh
mix test
```Only fast tests:
```sh
mix test --exclude slow
```## Example Usage
```example.ex
# Read rnw file
{:ok, file_content} = File.read("example.rnw")# Parse file content
{:ok, %Renewex.Document{} = document} = Renewex.parse_document(file_content)
{:ok, %LayeredDocument{
version: version,
# ^ 11
kind: kind,
# ^ de.renew.gui.CPNDrawing
layers: layers,
# ^ [%RenewexConverter.Layer{
# id: _,
# content: _,
# tag: "de.renew.gui.PlaceFigure",
# z_index: 0,
# hidden: false} | _]
hierarchy: hierarchy,
# ^ [%LayeredDocument.Nesting{
# ancestor_id: _,
# descendant_id: _,
# depth: 0} | _]
hyperlinks: hyperlinks,
# ^ [%LayeredDocument.Hyperlink{
# source_id: _,
# target_id: _} | _]
}} = RenewexConverter.consume_document(doc)
```---
[www.laszlokorte.de](//www.laszlokorte.de)