We've built the Open Law Platform that governments can use to do this with their official laws. We just launched with the Maryland Secretary of State last month at regs.maryland.gov. You can see the "source code" at https://github.com/maryland-dsd/law-xml, and the "compiled" code at any point in time since they started using our system at https://github.com/maryland-dsd/law-xml-codified and https://github.com/maryland-dsd/law-html. All cryptographically signed at https://github.com/maryland-dsd/law.