Browse Source

Merge pull request 'Add Changelog and "tag" optic' (#3) from add-changelog into master

Reviewed-on: prosidy/prosidy#3
chris-martin-patch-1
alex 1 year ago
parent
commit
477cdfe66f
  1. 8
      CHANGELOG
  2. 40
      README.pro
  3. 25
      prosidy.cabal
  4. 8
      src/Prosidy/Optics/Types.hs

8
CHANGELOG

@ -0,0 +1,8 @@
# v1.5.0.1 _(2020-02-24)_
- Added `CHANGELOG` to its own file.
- Included `CHANGELOG` and `README.pro` in the source distribution.
- Added an optic for fetching the name of a `Tag`.
# v1.5.0.0 _(2020-02-23)_
- Added tests for GHC 8.4.4 through 8.6.1.
- Initial stable release.

40
README.pro

@ -30,42 +30,4 @@ Reach me at #link[url='mailto:alex@fldcr.com']{alex@fldcr.com}.
#-h{Developing Prosidy}
This project sets up an environment using direnv and Nix.
We'd recommend you have both installed before building,
although it may work without both.
#-h{Changelog}
#-h+{2020-02-23}
#-list:
#-item{Added compatibility all the way back to GHC 8.4.}
#:
#-h+{2020-02-22}
#-list:
#-item{Large refactor to allow unopinionated use of this library. Optics are no longer "basically required".}
#-item{Full documentation of the public-facing API.}
#:
#-h+{2020-02-15}
#-list:
#-item{Pulled apart the monorepo again to allow for uploading to Hackage.}
#:
#-h+{2020-01-28}
#-list:
#-item{Fixed a few parser errors, specifically around comments.}
#-item{Added support for the first line of a Prosidy file to be a hash-bang (in both VSCode and the core parser)}
#:
#-h+{2020-01-24}
#-list:
#-item{Combined multiple Cabal projects into a super-Cabal file.}
#:
#-h+{2020-01-19}
#-list:
#-item{Added source tags to all Prosidy elements meaning better errors!}
#:
#-h+{2020-01-03}
#-list:
#-item{Refactored the various Prosidy repositories into a single monorepo.}
#:
although it may work without both.

25
prosidy.cabal

@ -1,15 +1,16 @@
cabal-version: 2.4
name: prosidy
version: 1.5.0.0
synopsis: A simple language for writing documents.
license: MPL-2.0
license-file: LICENSE
author: James Alexander Feldman-Crough
maintainer: alex@fldcr.com
copyright: ©2020 to James Alexander Feldman-Crough
category: Language
data-dir: data
data-files: golden/**/*.pro, golden/**/*.json
cabal-version: 2.4
name: prosidy
version: 1.5.0.1
synopsis: A simple language for writing documents.
license: MPL-2.0
license-file: LICENSE
author: James Alexander Feldman-Crough
maintainer: alex@fldcr.com
copyright: ©2020 to James Alexander Feldman-Crough
category: Language
data-dir: data
data-files: golden/**/*.pro, golden/**/*.json
extra-source-files: CHANGELOG, README.pro
tested-with:
GHC == 8.4.4

8
src/Prosidy/Optics/Types.hs

@ -18,6 +18,8 @@ module Prosidy.Optics.Types
, atSetting
-- ** Items wrapping content
, HasContent(..)
-- * Accessors for fields not otherwise covered
, tag
-- * Conversion between 'Tag's and 'Region's.
, tagged
-- * Prisms on 'Block' contexts
@ -148,6 +150,12 @@ instance HasContent Paragraph where
content = lens paragraphContent (\t c -> t { paragraphContent = c })
{-# INLINE content #-}
-------------------------------------------------------------------------------
-- | Focus on the name of a 'Tag'.
tag :: Lens' (Tag a) Key
tag = lens tagName (\t n -> t { tagName = n })
{-# INLINE tag #-}
-------------------------------------------------------------------------------
-- | Focus on the inner 'Region' of 'Tag's with a name. This can be used to
-- filter 'Tag's to a specific subset for manipulation.

Loading…
Cancel
Save