Giter Site home page Giter Site logo

codex-mirror's Introduction

GitHub go.mod Go version GitHub release (latest by date) Go Report Card License GitHub CI GitHub CD Website

Codex Mirror for Formosa & Pescadores

⚠️ Personal project to track changes of laws. USE AT YOUR OWN DISGRESSION.

ℹ️ Please refer to 全國法規資料庫 for the most accurate and up-to-date material.

🌐 Hosting on Github Pages https://iunn-sh.github.io/codex-mirror

dir content format
raw downloaded and unzipped files .zip / .csv / .json
depot parsed data from raw .json
docs processed data for frontend .md

Local Development

# Go: process data 
## with Docker
docker run --rm $(docker build -t codex-mirror -q .)
docker run --rm $(docker build -t codex-mirror --progress=plain --no-cache .) # debug
## with Golang (tested with 1.20)
go fmt ./...
go mod tidy
go run .

# Mkdocs Material: host frontend
docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material:9.5.5
# visit http://localhost:8000/ from browser

Production Deployment

Commit or merge PR to main branch

codex-mirror's People

Contributors

iunn-sh avatar

Watchers

 avatar

codex-mirror's Issues

Create folders if not exist

AC: if target folders (raw / docs / depot) do not exist, create them then proceed on file operations.

ci#144 got connection refused when downloading zip. Hence empty folders ended up in folder deletions.

3:23AM ERR error="Get \"[https://law.moj.gov.tw/api/Ch/Law/JSON\](https://law.moj.gov.tw/api/Ch/Law/JSON/)": dial tcp 163.29.130.173:443: connect: connection refused"
3:23AM ERR error="open /home/runner/work/codex-mirror/codex-mirror/raw/ChLaw.json.zip: no such file or directory"
3:23AM ERR error="open /home/runner/work/codex-mirror/codex-mirror/raw/ChLaw.json: no such file or directory"

Deploy to Github Pages when there is change in ./docs

Currently, git-auto-commit Action (in cron.yml) will not trigger main.yml to prevent endless workflow https://github.com/stefanzweifel/git-auto-commit-action#commits-made-by-this-action-do-not-trigger-new-workflow-runs

Workaround for now: combine cron.yml & ci.yml, so there is a daily rebuild 39a1f27

AC:

  • if there are substantial changes in website content (namely ./docs/*.md), a deployment should be triggered
  • if there is only .zip or .json changes, ignore them

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.