Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

parse.js 946B

123456789101112131415161718192021222324252627282930313233343536
  1. 'use strict'
  2. var content = require('./initialize/content.js')
  3. var document = require('./initialize/document.js')
  4. var flow = require('./initialize/flow.js')
  5. var text = require('./initialize/text.js')
  6. var combineExtensions = require('./util/combine-extensions.js')
  7. var createTokenizer = require('./util/create-tokenizer.js')
  8. var miniflat = require('./util/miniflat.js')
  9. var constructs = require('./constructs.js')
  10. function parse(options) {
  11. var settings = options || {}
  12. var parser = {
  13. defined: [],
  14. constructs: combineExtensions(
  15. [constructs].concat(miniflat(settings.extensions))
  16. ),
  17. content: create(content),
  18. document: create(document),
  19. flow: create(flow),
  20. string: create(text.string),
  21. text: create(text.text)
  22. }
  23. return parser
  24. function create(initializer) {
  25. return creator
  26. function creator(from) {
  27. return createTokenizer(parser, initializer, from)
  28. }
  29. }
  30. }
  31. module.exports = parse