Skip to content

Commit

Permalink
chore(format): 🤖 ✨ (#24)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
ecoscript[bot] and github-actions[bot] committed Aug 23, 2023
1 parent 221895a commit 741d07d
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 37 deletions.
20 changes: 10 additions & 10 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ In the interest of fostering an open and welcoming environment, we as contributo

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ All children must be typed. The type makes it possible for a serializer to parse
Marks are how we mark up inline text with additional data/features. Marks comes in two forms: Decorators and Annotations. Decorators are marks as simple string values, while Annotations are keys to a data structure. `marks` is therefore either an array of string values, or keys, corresponding to `markDefs`, with the same `_key`. See the examples below, or check out this [live CodeSandbox example with an inline image and a link](https://codesandbox.io/s/awesome-sammet-71gy8?file=/src/App.js):

Decorator example:

```json
[
{
Expand All @@ -132,6 +133,7 @@ Decorator example:
```

Annotation example:

```json
[
{
Expand All @@ -141,7 +143,7 @@ Annotation example:
"_type": "span",
"text": "Portable Text",
"marks": ["<markDefId>"] // this corresponds to a `"_key"` in `markDefs`
},
}
],
"markDefs": [
{
Expand All @@ -154,7 +156,6 @@ Annotation example:
]
```


#### Text (string)

The text contents of the span.
Expand Down Expand Up @@ -208,10 +209,12 @@ Examples of custom blocks:

- The `SanityHtmlBuilder` class in [the Sanity LINQ client](https://github.com/oslofjord/sanity-linq)
- [Portable Text .NET](https://github.com/nhi/portable-text-dotnet), a C# HTML converter to Portable Text, also supporting custom types. (A graceful port of [`blockTools.htmlToBlocks()`](https://www.npmjs.com/package/@sanity/block-tools#htmltoblockshtml-blockcontenttype-options-html-deserializer) to C#)
-
-

#### Dart/Flutter

- [flutter_portabletext](https://github.com/JobiJoba/flutter_portabletext)

---

Portable Text is presented by [Sanity.io](https://github.com/sanity-io)
51 changes: 27 additions & 24 deletions examples/withLink.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
[{
[
{
"_type": "block",
"_key": "3628734dd519",
"style": "normal",
"markDefs": [{
"markDefs": [
{
"_type": "link",
"_key": "e556761904ba",
"href": "https://www.portabletext.org"
}],
"children": [{
"_type": "span",
"_key": "3628734dd5190",
"text": "This is a paragraph with a ",
"marks": []
},
{
"_type": "span",
"_key": "3628734dd5191",
"text": "link",
"marks": [
"e556761904ba"
]
},
{
"_type": "span",
"_key": "3628734dd5192",
"text": ".",
"marks": []
}
}
],
"children": [
{
"_type": "span",
"_key": "3628734dd5190",
"text": "This is a paragraph with a ",
"marks": []
},
{
"_type": "span",
"_key": "3628734dd5191",
"text": "link",
"marks": ["e556761904ba"]
},
{
"_type": "span",
"_key": "3628734dd5192",
"text": ".",
"marks": []
}
]
}]
}
]

0 comments on commit 741d07d

Please sign in to comment.