Commit Graph

34 Commits

Author SHA1 Message Date
Felix Krause c509953289 Documentation overhaul.
* submodule docs are now located at /api/yaml/<name>.html instead of
   /api/<name>.html.
 * can now simply link to symbols in other modules.
 * fixed some links
 * fixed quickstart example list
 * added quickstart item displaying the new style api
 * fixed a bug in presenter that doubled a line in literal/flow style
2023-11-27 23:05:05 +01:00
Felix Krause bf87d508d0 Fixed presenter regarding new style annotations
* fixed presentation of flow mappings inside block collections
 * improved logic checking whether a collection can be written on a
   single line
 * fixed tests
2023-11-14 15:30:43 +01:00
Felix Krause 03c95da97c Presenter improvements and new features
* Presenter now tries to write style given in event
 * Can write single quoted
 * several fixes to line length handling
 * sever other presenter fixes
 * updated server deps
 * updated server code to use new presenter features
   (or rather, not use, as the server *should* alter the
   input style instead of outputting it as-is)
2023-11-11 13:20:56 +01:00
Felix Krause 3d98b5ea22 don't present block scalars in flow collections
* ensure no block scalars (literal, folded) are output inside of flow
   collections
 * ref #140
2023-11-07 22:48:42 +01:00
Felix Krause bf65a97cbe Fixed indentation problems when dumping
* certain configurations of the Dumper added twice the requested
   indentation.
 * ref #140
2023-11-07 21:55:13 +01:00
Felix Krause 854d33378e fixes #101, minor improvements
* improved error reporting on wrong tags
 * removed a debug `echo` call
 * fixed problems with sparse objects and Option (#101)
2023-11-05 15:10:29 +01:00
Felix Krause fe4449aaec Fixed server, improved docs
* made docs server compile again
 * improved migrating documenattion
 * improved CSS for mobile devices
 * fixed GitHub link
2023-09-04 22:48:04 +02:00
Felix Krause 940675a52e Reworked loading API
* moved load procs to yaml/loading.nim
 * moved input YamlStream into ConstructionContext
 * made ConstructionContext a non-ref object
 * harmonized code style & comments
 * renamed yaml/serialization.nim to yaml/native.nim
2023-08-29 23:23:15 +02:00
Felix Krause 18fc8ba3f5 Reworked dumping API
* removed default value objects,
   use Nim2 default vaules for fields instead.
 * moved dump procs to yaml/dumping and introduced Dumper
 * modified serialization procs to use ctx as first argument,
   so that prefix calls can be used
 * changed defaults for presentation to be more like other
   YAML implementations, e.g. no directives by default.
 * Removed deprecated procs in DOM API
 * Removed PresentationStyle – use the setXStyle procs of Dumper
   instead.
 * Fixed some warnings emerging from transitioning to Nim2
2023-08-29 20:46:26 +02:00
Felix Krause 189844a72b Rewrote large parts of presenter
* PresentationOptions has gained more fine-tuning options:
   * directivesEnd: specifies when `---` is written. ref #135
   * containers: specifies whether containers use block or flow style
   * suppressAddrs: if set, suppresses output of attributes
   * quoting: specifies how strings should be quoted
   * condenseFlow: specifies whether flow sequences should be on a
     single line
   * explicitKeys: specifies whether mapping keys should always have '?'
 * PresentationStyle is now a list of presets that set
   multiple options in PresentationOptions.
 * Does not output trailing spaces anymore. ref #135
 * Writes compact notation, i.e. a mapping in a sequence starts on the
   line with the sequence's `-`, unless attributes are written
 * Added tests for the presenter
 * Existing code might change behavior because of whitespace, `---` and
   compact notation. The API has been extended so that existing code is
   affected as little as possible.
2023-07-31 19:16:24 +02:00
Felix Krause 39444f6536 Consolidated exceptions 2023-03-18 13:54:45 +01:00
Felix Krause 7bd562e37e Fixes and improvements to DOM API.
* added loadFlattened. Fixes #117
 * fixed an error where recursive nodes were not loaded
   properly into YamlNodes.
 * made dump with asNone raise an error when a cycle is
   encountered, instead of running into an endless loop.
2022-09-07 16:23:50 +02:00
Felix Krause 5f7677d914 Improved presenter.
* added maxLineLength to PresentationOptions. Fixes #119
 * write a newline to the end of the document.
   required for the output files to be POSIX-compliant text files.
   also improves QoL when dumping to stdout.
2022-09-07 15:15:55 +02:00
flyx 89e18cebfa
fix #105
fixed an off-by-one error when presenting folded scalars
2022-01-22 01:18:11 +01:00
Felix Krause d704a8c6d7 fixed compiler warnings 2021-10-22 17:46:05 +02:00
Felix Krause 1346467b42 fixes #93 2021-05-18 00:31:47 +02:00
Felix Krause 2b0e20abd0 fixed server to compile with current Nim 2021-05-17 19:50:10 +02:00
Felix Krause 329e18e44c removed obsolete TagLibrary type. control tag directives when dumping. fixes #95 2021-03-23 18:51:05 +01:00
Felix Krause f79774e766 updated raises annotations 2020-11-10 21:28:56 +01:00
Felix Krause aa65c066d5 changed TagId to Tag. removed JS stuff that wasn't working anyway. 2020-11-10 13:55:22 +01:00
Felix Krause 6238104622 started making serializationTests green again 2020-11-06 21:39:50 +01:00
Felix Krause 48d601d959 parser tests working, other tests compiling 2020-11-06 16:21:58 +01:00
Felix Krause 4c604b09df made lexer & parser tests compile (not succeed) again 2020-11-04 16:40:37 +01:00
Felix Krause 1d707b184e started updating other parts of the codebase 2020-11-03 22:08:21 +01:00
Kobi 053d5d1333 removed empty lines
(probably from nimpretty formatting?)
2019-01-27 12:07:16 +01:00
Kobi Lurie 9226aa4d37 modified presenter to work with deques instead of the obsolete queues 2019-01-27 12:07:16 +01:00
Felix Krause 0ef9cbf535 Moved private sources to yaml/private 2017-02-06 20:39:04 +01:00
Felix Krause 936df70daa Correctly present empty collections in block-only.
* Fixes #33
2017-01-10 11:45:55 +01:00
Felix Krause 87bfcd1490 Fixed bugs
* lexer did not handle indentation indicator for block scalars properly
 * transform() did not work properly for string output
2016-12-13 21:22:36 +01:00
Felix Krause 4b529c1fd6 Fixed and improved presenter.transform
* Added option to resolve non-specific tags
 * Actually resolve non-specific tags
 * Made it compile again after hints enhancement
2016-12-05 18:27:32 +01:00
Felix Krause 29352fa4fe Use global tag handle for NimYAML
* NimYAML now uses the tag prefix tag:nimyaml.org,2016:
 * That tag handle is shortened to !n! when presenting
 * Also fixed some minor bugs dealing with tag handles
2016-10-10 20:16:54 +02:00
Felix Krause 1dc8ddc6ea got rid of yaml.common 2016-09-22 13:28:24 +02:00
Felix Krause 5dfc984913 Updated documentation for new structure 2016-09-21 21:20:57 +02:00
Felix Krause 12960b2e31 Restructuring: no more includes 2016-09-20 21:53:38 +02:00