Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ディレクトリ配下のファイルでもプレビューだけ表示できるように修正 #121

Merged
merged 2 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
Expand Down
Empty file.
204 changes: 204 additions & 0 deletions examples/example_user1/articles/sample-article.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
---
title: "Code Fence"
emoji: 👩‍💻
type: "tech" # or "idea"
topics:
- React
- Rust
published: false
---

```"><img/onerror="alert(location)"src=.>
any
```

```tf
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 1.0.4"
}
}
}

variable "aws_region" {}

variable "base_cidr_block" {
description = "A /16 CIDR range definition, such as 10.1.0.0/16, that the VPC will use"
default = "10.1.0.0/16"
}

variable "availability_zones" {
description = "A list of availability zones in which to create subnets"
type = list(string)
}

provider "aws" {
region = var.aws_region
}

resource "aws_vpc" "main" {
# Referencing the base_cidr_block variable allows the network address
# to be changed without modifying the configuration.
cidr_block = var.base_cidr_block
}

resource "aws_subnet" "az" {
# Create one subnet for each given availability zone.
count = length(var.availability_zones)

# For each subnet, use one of the specified availability zones.
availability_zone = var.availability_zones[count.index]

# By referencing the aws_vpc.main object, Terraform knows that the subnet
# must be created only after the VPC is created.
vpc_id = aws_vpc.main.id

# Built-in functions and operators can be used for simple transformations of
# values, such as computing a subnet address. Here we create a /20 prefix for
# each subnet, using consecutive addresses for each availability zone,
# such as 10.1.16.0/20 .
cidr_block = cidrsubnet(aws_vpc.main.cidr_block, 4, count.index+1)
}
```

ref: https://github.com/zenn-dev/zenn-community/issues/357

<!-- should ignore foo -->

```js foo
const foo = function (bar) {
return bar++;
};
```

```diff jsx:src/App.js
function App() {
const [count, setCount] = useState(0);

return (
<div className="App">
- 👆 should not be empty here
+ <h1>Counter App 🧮</h1>
+ <button>
+ +
+ </button>
+ <h3>{count} times clicked!🖱</h3>
</div>
);
}

export default App;
```

```vue:index.vue
<template>
<div class="todo">
<h1>TODO APP</h1>
</div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';

export default defineComponent({
name: 'Todo',
});
</script>
```

```Dockerfile:Dockerfile
FROM ubuntu
ENV name value # comment
ENV name=value
CMD ["echo", "$name"]
```

```bash:foo.fish
bind -M $mode \cq foo
```

```diff
@@ -4,6 +4,5 @@
- let foo = bar.baz([1, 2, 3]);
- foo = foo + 1;
+ const foo = bar.baz([1, 2, 3]) + 1;
console.log(`foo: ${foo}`);
```

```diff
@@ -4,6 +4,5 @@
- let foo = bar.baz([1, 2, 3]);
- foo = foo + 1;
+ const foo = bar.baz([1, 2, 3]) + 1;
console.log(`foo: ${foo}`);
```

```js diff:diff with looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong lang
@@ -4,6 +4,5 @@
- let foo = bar.baz([1, 2, 3]);
- foo = foo + 1;
+ const foo = bar.baz([1, 2, 3]) + 1;
console.log(`foo: ${foo}`);
```

```js diff:diff with lang
@@ -4,6 +4,5 @@
- let foo = bar.baz([1, 2, 3]);
- foo = foo + 1;
+ const foo = bar.baz([1, 2, 3]) + 1;
console.log(`foo: ${foo}`);
```

```diff js:diff with lang
@@ -4,6 +4,5 @@
- let foo = bar.baz([1, 2, 3]);
- foo = foo + 1;
+ const foo = bar.baz([1, 2, 3]) + 1;
console.log(`foo: ${foo}`);
```

```js:fooBar.js
var foo = function (bar) {
return bar++;
};

console.log(foo(5));
// 👇can scroll horizontally
console.log(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
```

```js:example
var foo = function (bar) {
return bar++;
};
```

```html:<should escape>
var foo = function (bar) {
return bar++;
};
```

```html
<div>a</div>
```

```diff html:html差分
<div>a</div>
- <div>b</div>
+ <div>c</div>
```

```html diff : html差分
<div>a</div>
-
<div>b</div>
+
<div>c</div>
```

```"><img/onerror="alert(location)"src=.>
"><img/onerror="alert(location)"src=.>
```
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@
"@types/webpack-env": "^1.17.0",
"@typescript-eslint/eslint-plugin": "^5.30.0",
"@typescript-eslint/parser": "^5.30.0",
"@vscode/test-web": "^0.0.26",
"@vscode/test-web": "^0.0.65",
"@vscode/vsce": "^3.2.2",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nits] vsce は非推奨だから @vscode/vsce に変えてねとコンソールに出たため従いました。

"assert": "^2.0.0",
"crypto-browserify": "^3.12.0",
"css-loader": "^6.7.1",
Expand All @@ -243,7 +244,6 @@
"style-loader": "^3.3.1",
"ts-loader": "^9.3.1",
"typescript": "^4.7.4",
"vsce": "^2.13.0",
"webpack": "^5.73.0",
"webpack-cli": "^4.10.0"
},
Expand Down
Loading