React with Native

Bringing together React and React Native

GitHub

README

Markdown types

markdown-types (

OperationClassification

TODO: Ensure embedding this will embed the actual docs in my markdown renderer. I guess it might already do so!

TODO: It would be great to learn more about this topic and see if I can make more cross-environment packages. A great use case would be to create a wrapper around the current fs-orm to enable using it at the frontend too.

OperationClassification cjs)

Api reference
🔹 MarkdownParse

Properties:

NameTypeDescription
fileName (optional)string
createdAt (optional)number
openedAt (optional)number
updatedAt (optional)number
deletedAt (optional)number
createdFirstAt (optional)number
parametersobject
content (optional)array
rawstring
🔸 WebMarkdownFile

markdown model

Every markdown file meant for the web, should have these optional parameters that can be declared as its frontmatter

NB: This is not part of MarkdownModelType, because MarkdownModelType is very barebones general purpose, not only for the web!

Properties:

NameTypeDescription
isPreset (optional)boolean
isPostable (optional)boolean
isCodestory (optional)boolean
tsInterfaceIds (optional)array
tsFunctionIds (optional)array
bundleConfigSlugs (optional)array
operationIds (optional)array
reference_assets (optional)array
headerImage (optional)object
headerTitle (optional)string
headerBig (optional)boolean
headerSubTitle (optional)string
header_markdownCallToActionSlugs (optional)array
domain (optional)string
markdownCallToActionSlugs (optional)array
shop_itemIds (optional)array
author_personSlugs (optional)array
interestSlugs (optional)array
price (optional)number
isDraft (optional)boolean
updatedAtnumber
createdAtnumber
privacystring
languagestring
isLanguageCustom (optional)boolean
deletedAtnumber
createdFirstAtnumber
operationNamenull
projectRelativePathstring
operationRelativePath (optional)string
idstring
namestring
slugstring
markdownstring
categoryStackCalculatedarray
🔹 MarkdownChunk

Properties:

NameTypeDescription
levelnumber
content (optional)string
markdownEmbed (optional)object
markdownLink (optional)object
title (optional)string
children (optional)array
🔹 PostableProperties

Postable is not extending a modeltype anymore, it can be attached to any

MarkdownModelType

Handy model type for storing stuff in a Markdown file.

1 markdown file will represent 1 MarkdownModelType extended instance

another option could be to parse the markdown file, but to KISS we are going to just return markdown with the full markdown content

TODO: see how this relates to MarkdownFile. Make this very clear!

MarkdownModelType model

Properties:

NameTypeDescription
isPreset (optional)boolean
isPostable (optional)boolean
isCodestory (optional)boolean
tsInterfaceIds (optional)array
tsFunctionIds (optional)array
bundleConfigSlugs (optional)array
operationIds (optional)array
reference_assets (optional)array
🔹 ExtendedMarkdownProperties

Some properties for on any

MarkdownModelType

Handy model type for storing stuff in a Markdown file.

1 markdown file will represent 1 MarkdownModelType extended instance

another option could be to parse the markdown file, but to KISS we are going to just return markdown with the full markdown content

TODO: see how this relates to MarkdownFile. Make this very clear!

MarkdownModelType model that are quite general purpose and yet aren't included into the MarkdownModel because we may not always want them.

Properties:

NameTypeDescription
isDraft (optional)boolean
updatedAtnumber
createdAtnumber
privacystring
languagestring
isLanguageCustom (optional)boolean
🔸 MarkdownCallToAction

jsonMultiple model

Properties:

NameTypeDescription
slugstring
namestring
languagestring
createdAtnumber
updatedAtnumber
deletedAtnumber
createdFirstAtnumber
operationNamenull
projectRelativePathstring
operationRelativePath (optional)string
idstring
categoryStackCalculated (optional)array
path (optional)stringAbsolute queryPath to the CTA. Leave empty for going to the homepage. Empty paths will be omitted on the domains where you are already on that domain... If there's a path, will be omitted on other domains (MarkdownCallToActions with a different hostname)
hostnamestringHostname as described in https://www.w3schools.com/js/js_window_location.asp.
title (optional)string
description (optional)string
ctaButtonText (optional)string
onlyFooter (optional)boolean
onlyHeader (optional)boolean
isMinimised (optional)boolean
bannerImage (optional)object
🔹 WebMarkdownProperties

Properties:

NameTypeDescription
headerImage (optional)object
headerTitle (optional)string
headerBig (optional)boolean
headerSubTitle (optional)string
header_markdownCallToActionSlugs (optional)array
domain (optional)string
markdownCallToActionSlugs (optional)array
shop_itemIds (optional)array
author_personSlugs (optional)array
interestSlugs (optional)array
price (optional)number
tryParseDate()

Tries to parse a date from a string

  • implements default behavior of new Date with a try catch
  • returns a unix timestamp (ms since 1970 AD)

TODO: put in a better location... date-util?

Input
dateStringstring
Outputnumber
🔹 MarkdownEmbed

Anything in the format ![alt](src)

NB: I need to be very clear how this one works

Properties:

NameTypeDescription
altstring
srcstring
typestring

Anything in the format [alt](href)

It needs to be clear how this works. There is a convention for this, and I should implement that as good as possible, and document it here

Properties:

NameTypeDescription
altstring
hrefstring
typestring
🔹 MarkdownParagraph

Properties:

NameTypeDescription
paragraphstring
categoryStackCalculatedarray
level (optional)number
🔹 TextJson

TODO: Rename

Properties:

NameTypeDescription
json (optional)object
typescriptJson (optional)object
markdownJson (optional)object
pathstring
isFolderboolean
stats (optional)object
metaData (optional)object
isCancelRecursionResult (optional)boolean
📄 tryParseDate (exported const)

Tries to parse a date from a string

  • implements default behavior of new Date with a try catch
  • returns a unix timestamp (ms since 1970 AD)

TODO: put in a better location... date-util?

Internal
Show internal (8)
markdownParseToMarkdownModelType()

makes a markdownModelType from a markdownParse.

Input
markdownParse{ }
Output
parseMarkdownModelTimestamp()

First tries to look at the frontmatter value, this is leading because it is what the user sees and the file system of the os could be inconsistent

If this frontmatter doesn't exist, the markdownParse is checked for a date. This should be information collected from the file system

If that doesn't succeed, sometimes we'll set it to the current timestamp

Input
parametersFrontmatter
Output{ }
🔹 MarkdownContentLevel

0 is a paragraph 1-6 is h1 until h6

🔹 MarkdownHeader

Properties:

NameTypeDescription
levelnumber
titlestring
🔸 WebsiteHeader

jsonMultiple model

Properties:

NameTypeDescription
headerImage (optional)object
headerTitle (optional)string
headerBig (optional)boolean
headerSubTitle (optional)string
header_markdownCallToActionSlugs (optional)array
slugstring
namestring
languagestring
createdAtnumber
updatedAtnumber
deletedAtnumber
createdFirstAtnumber
operationNamenull
projectRelativePathstring
operationRelativePath (optional)string
idstring
categoryStackCalculated (optional)array
🔹 WebsiteHeaderProperties

Properties:

NameTypeDescription
headerImage (optional)object
headerTitle (optional)string
headerBig (optional)boolean
headerSubTitle (optional)string
header_markdownCallToActionSlugs (optional)array
📄 markdownParseToMarkdownModelType (exported const)

makes a markdownModelType from a markdownParse.

📄 parseMarkdownModelTimestamp (exported const)

First tries to look at the frontmatter value, this is leading because it is what the user sees and the file system of the os could be inconsistent

If this frontmatter doesn't exist, the markdownParse is checked for a date. This should be information collected from the file system

If that doesn't succeed, sometimes we'll set it to the current timestamp