Apple 新闻 JSON 格式和降价链接
Apple news JSON format and links in markdown
我对以 JSON 格式发布的苹果新闻文章中的内容使用降价语法。
我注意到 links 被正确解析,但 link 文本未显示为蓝色(或任何其他有助于从普通文本突出显示 links 的颜色)。
据我所知,使用降价格式时无法添加更多样式,因此我不确定还需要设置什么样式 links.
有没有其他技巧可以用蓝色完成 links?还是新闻应用程序中的一种错误?
谢谢。
Apple News 文件的样式是使用 Text Styles and Component Text Styles 完成的。
后者提供的示例正是您想要的,即如何设置链接样式:
{
"fontName": "GillSans-Bold",
"fontSize": 12,
"lineheHeight": 15,
"paragraphSpacingBefore": 20,
"paragraphSpacingAfter": 20,
"textColor": "#000000",
"textAlignment": "right",
"lineHeight": 14,
"firstLineIndent": 20,
"linkStyle": {
"underline": {
"color": "#2a6496"
}
}
}
这些文本样式可以放在文章的 textStyles property 中,也可以内联。
{
"role": "body",
"text": "Lorem *ipsum*",
"textStyle": {AS ABOVE}
}
希望对您有所帮助!
我对以 JSON 格式发布的苹果新闻文章中的内容使用降价语法。 我注意到 links 被正确解析,但 link 文本未显示为蓝色(或任何其他有助于从普通文本突出显示 links 的颜色)。 据我所知,使用降价格式时无法添加更多样式,因此我不确定还需要设置什么样式 links.
有没有其他技巧可以用蓝色完成 links?还是新闻应用程序中的一种错误?
谢谢。
Apple News 文件的样式是使用 Text Styles and Component Text Styles 完成的。
后者提供的示例正是您想要的,即如何设置链接样式:
{
"fontName": "GillSans-Bold",
"fontSize": 12,
"lineheHeight": 15,
"paragraphSpacingBefore": 20,
"paragraphSpacingAfter": 20,
"textColor": "#000000",
"textAlignment": "right",
"lineHeight": 14,
"firstLineIndent": 20,
"linkStyle": {
"underline": {
"color": "#2a6496"
}
}
}
这些文本样式可以放在文章的 textStyles property 中,也可以内联。
{
"role": "body",
"text": "Lorem *ipsum*",
"textStyle": {AS ABOVE}
}
希望对您有所帮助!