https://github.com/laszlokorte/renewex
Renew file parser written in Elixir.
https://github.com/laszlokorte/renewex
Last synced: 5 days ago
JSON representation
Renew file parser written in Elixir.
- Host: GitHub
- URL: https://github.com/laszlokorte/renewex
- Owner: laszlokorte
- Created: 2024-08-09T16:37:47.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-01-06T14:33:18.000Z (6 months ago)
- Last Synced: 2025-03-20T07:17:41.090Z (4 months ago)
- Language: Elixir
- Size: 1.52 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RenewEx

[Renew](http://renew.de/) file parser in Elixir.
[](https://hex.pm/packages/renewex) [](https://hexdocs.pm/renewex/)
---
## Test cases
Both parser and serializer are tested [on more than 1000 example files.](https://github.com/laszlokorte/renewex/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)# Inspect document:
IO.puts(document.version)
IO.puts(document.root)
IO.puts(Enum.count(document.refs))# Do some work with `document`
# ...# serialize document back into string
{:ok, serialized} = Renewex.serialize_document(document)# Write rnw file
File.write("modified.rnw", serialized)
```---
[www.laszlokorte.de](//www.laszlokorte.de)