Skip to content

Commit

Permalink
adding tests, moar logs, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
TimoKats committed Aug 21, 2024
1 parent ff7bb17 commit 2c34992
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
MDRSS is a markdown to RSS converter written in GO. With this tool, you can write articles in a local folder and have them automatically formatted to an RSS compliant XML file. As a result, you don't have to write articles on your website first and have them be read by an RSS reader. Moreover, MDRSS automatically takes care of publication dates, categories (next update), formatting, etc.

### Getting started
You can install the binary using `go install github.com/TimoKats/mdrss@latest` (make sure your GOPATH is set correctly!). After this you can add your configuration in `~/.mdrss/config.json`. This is a JSON file with a number of settings. You can use this template to setup your configuration
You can install the binary using `go install github.com/TimoKats/mdrss@latest` (make sure your GOPATH is set correctly!). After this you can add your configuration in `~/.mdrss/config.json`. This is a JSON file with a number of settings. You can use this template to setup your configuration. Note, the most recent update also allows users to specify their own config path, which you can define like so.

```shell
mdrss --config other/path/to/config update
```

```JSON
{
Expand All @@ -24,9 +28,8 @@ You can submit your RSS file to a public website, or put it somewhere easily ava
List of features that are on the planning. Feel free to send suggestions here.
* Display source code from markdown more correctly.
* For non textual RSS readers: render images.
* Ordered and unordered lists(!)
* Ordered


### Why RSS?
* No ads/trackers/cookies.
* No distractions when reading (it's just text).
Expand Down
12 changes: 8 additions & 4 deletions mdrss_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ package main

import (
mdrss "github.com/TimoKats/mdrss/lib"
"os/exec"
"testing"
)

func testConfig() mdrss.Config {
var config mdrss.Config
config.Description = "Testing weblog"
config.InputFolder = "test/"
config.OutputFile = "index.xml"
config.OutputFile = "rss.xml"
config.Author = "Testing Test"
config.Link = "test@testing.com"
return config
Expand Down Expand Up @@ -68,11 +69,14 @@ func TestBasics(t *testing.T) {
articles, _ := mdrss.GetArticles(config)
config.Articles = mdrss.ReadMarkdown(config, articles)
rssXml := mdrss.CreateRSS(config)
mdrss.WriteRSS(rssXml, config)
got := mdrss.FileExists("index.xml")
rssErr := mdrss.WriteRSS(rssXml, config)
got := mdrss.FileExists("rss.xml")
want := true
if got != want {
if got != want || rssErr != nil {
t.Errorf("got %v, wanted %v", got, want)
} else {
cmd := exec.Command("rm", "rss.xml")
cmd.Run()

Check failure on line 79 in mdrss_test.go

View workflow job for this annotation

GitHub Actions / linter check

Error return value of `cmd.Run` is not checked (errcheck)
}
}

0 comments on commit 2c34992

Please sign in to comment.