Skip to content

Commit 9955cca

Browse files
authored
Update 2023-07-04-jupyter-notebook.md
1 parent 85eb89f commit 9955cca

File tree

1 file changed

+11
-33
lines changed

1 file changed

+11
-33
lines changed
Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,22 @@
11
---
22
layout: post
3-
title: a post with jupyter notebook
4-
date: 2023-07-04 08:57:00-0400
5-
description: an example of a blog post with jupyter notebook
6-
tags: formatting jupyter
7-
categories: sample-posts
3+
title: Unraveling the Shape of Social Media Narratives
4+
date: 2025-06-04 08:57:00-0400
5+
description: Analyzing the Effects of Online Interaction and Narrative Structure
6+
tags: narrative
7+
categories: research
88
giscus_comments: true
99
related_posts: false
1010
---
1111

12-
To include a jupyter notebook in a post, you can use the following code:
12+
Our article “Unraveling the Shape of Social Media Narratives: Analyzing the Effects of Online Interaction and Narrative Structure on Attention to Digital Asset Transactions” has been accepted for publication in Journal of Broadcasting & Electronic Media.
1313

14-
{% raw %}
14+
> Zhang, Yaotian; Sun, Yixiao ‡; Wang, Cheng-Jun * (2025) Unraveling the Shape of Social Media Narratives: Analyzing the Effects of Online Interaction and Narrative Structure on Attention to Digital Asset Transactions. Journal of Broadcasting & Electronic Media. 69(3), 200–218. doi: 10.1080/08838151.2025.2484347. Data & Code: https://osf.io/zhwxy/
1515
16-
```html
17-
{::nomarkdown}
18-
{% assign jupyter_path = "assets/jupyter/blog.ipynb" | relative_url %}
19-
{% capture notebook_exists %}{% file_exists assets/jupyter/blog.ipynb %}{% endcapture %}
20-
{% if notebook_exists == "true" %}
21-
{% jupyter_notebook jupyter_path %}
22-
{% else %}
23-
<p>Sorry, the notebook you are looking for does not exist.</p>
24-
{% endif %}
25-
{:/nomarkdown}
26-
```
2716

28-
{% endraw %}
17+
## ABSTRACT
18+
Social media narratives are considered crucial in shaping the attention of digital assets. The interactive narrative model posits that online interactions and narrative structures affect individuals’ attention. Yet, the conceptualization of narrative structure’s temporal and spatial dimensions and their effects remain limited. Furthermore, few studies have addressed how online interactions influence narrative structure. We construct a three-wave panel data for 1,226 active users based on 16 million tweets and quantify narrative circuitousness, speed, and volume using the Word2Vec model. The results of two-way fixed-effects models reveal that high-speed, low-circuitousness, low-volume, and emotional narrative increase transaction attention. In addition, narrative structures mediate the relationship between online interactions and transaction attention. We contribute to the interactive narrative model by formulating and quantifying the temporal and spatial dimensions of narrative structure.
2919

30-
Let's break it down: this is possible thanks to [Jekyll Jupyter Notebook plugin](https://github.com/red-data-tools/jekyll-jupyter-notebook) that allows you to embed jupyter notebooks in your posts. It basically calls [`jupyter nbconvert --to html`](https://nbconvert.readthedocs.io/en/latest/usage.html#convert-html) to convert the notebook to an html page and then includes it in the post. Since [Kramdown](https://jekyllrb.com/docs/configuration/markdown/) is the default Markdown renderer for Jekyll, we need to surround the call to the plugin with the [::nomarkdown](https://kramdown.gettalong.org/syntax.html#extensions) tag so that it stops processing this part with Kramdown and outputs the content as-is.
3120

32-
The plugin takes as input the path to the notebook, but it assumes the file exists. If you want to check if the file exists before calling the plugin, you can use the `file_exists` filter. This avoids getting a 404 error from the plugin and ending up displaying the main page inside of it instead. If the file does not exist, you can output a message to the user. The code displayed above outputs the following:
33-
34-
{::nomarkdown}
35-
{% assign jupyter_path = "assets/jupyter/blog.ipynb" | relative_url %}
36-
{% capture notebook_exists %}{% file_exists assets/jupyter/blog.ipynb %}{% endcapture %}
37-
{% if notebook_exists == "true" %}
38-
{% jupyter_notebook jupyter_path %}
39-
{% else %}
40-
<p>Sorry, the notebook you are looking for does not exist.</p>
41-
{% endif %}
42-
{:/nomarkdown}
43-
44-
Note that the jupyter notebook supports both light and dark themes.
21+
### Data availability statement
22+
The data analyzed is available in the Open Science Framework (OSF), and the hyperlink is https://osf.io/zhwxy (DOI: 10.0.68.197/OSF.IO/ZHWXY). The raw data will be shared on reasonable request to the corresponding author.

0 commit comments

Comments
 (0)