Simple app to serve the SMPTE Language Metadata Table to Machines and Humans
You will need
- NodeJS (Mac, Win, Linux)
- Yarn if you want a slightly slicker sustaining experience
- pm2 or some other process manager for production (heroko, azure, amazon etc.)
Clone the repo
git clone https://github.com/smpte/RegLMT-WebTools.git
cd RegLMT-WebToolsand then install dependencies with yarn or npm
yarn install --production or npm install --production
then start the server
yarn install --production or npm install --production or pm2 start lmt-srv/server-lmt.js
To test the page locally, you need to start the server and connect a browser to the
correct port. The default would be to connect to http://localhost:3000
The server root folder is /dist/
/dist/client-side//dist/client-side/index.htmlthis is the client side demo html file for demonstrating the functionality - load it in a browser.<link rel="stylesheet" href="css/prism-twilight.css" />in the header loads the styles for syntax highlighting<script src="proto-lmt.js"></script>in the header loads the javascript to run the page<div id="lmt-narrative"></div>is whereabstract.mdwill be rendered ass HTML with the current styles<div id="lmt-buttons"></div>is where the buttons will be rendered (one per transform type)<div id="lmt-rendering"></div>is where the output of a rendering is written
lmt-narrative.mdis the markrdown file with the introduction to a version of LMTlmt.xmlis the full XML of the LMT to be publishedlmt-schema.xsdis the schema that is used for validation (defined in the RDD)css/folder with various style sheetssite.cssshould contain any custom css to make this page display correctlyprism-xxx.cssis the highglight style for doing the xml pretty printing
If you update the app in the src/ folder then you need to npm run build to package all the javascript before
running npm start to do testing.
The file /config/default.json contains the following configuration settings:
app_titleA short string used in the window<title>attribute and the main headerapp_descriptionAn HTML string inserted below the tile on the page,versionversion number of the appportThe port that the app will respond to (default=3000)staticcontrols the static files served to the clientrootname of the folder from which all static assets will be served (cssfiles,index.html, javascript files etc.templatename of the template file for serving the content
url_prefixa prefix beginning with/indicating a mount point that the app should respond to (default = empty, typical =/vocabularies/lmt)cachetemp folder where server can store rendered copies of its assetsloggingcontrol the logging ofd the outputslevelminimum error level for the app to log (info,warning,error)log_requestsset totrueorfalse
The app uses the pino logger.