PHPackages                             ttskch/esaba - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. ttskch/esaba

ActiveProject[Parsing &amp; Serialization](/categories/parsing)

ttskch/esaba
============

Host your markdown docs on esa.io with your own css.

2.2.2(4y ago)18864[1 issues](https://github.com/ttskch/esaba/issues)MITPHPPHP &gt;=8.0.2

Since Oct 20Pushed 4y ago2 watchersCompare

[ Source](https://github.com/ttskch/esaba)[ Packagist](https://packagist.org/packages/ttskch/esaba)[ RSS](/packages/ttskch-esaba/feed)WikiDiscussions main Synced 4d ago

READMEChangelog (10)Dependencies (23)Versions (17)Used By (0)

esaba
=====

[](#esaba)

[![Test Status](https://github.com/ttskch/esaba/actions/workflows/test.yaml/badge.svg)](https://github.com/ttskch/esaba/actions/workflows/test.yaml)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b0f0090e7a2a8e6e5eb190a8229c28ecb66a6b77e7f65862b3f9f18ad45469ae/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7474736b63682f65736162612f6261646765732f7175616c6974792d73636f72652e706e67)](https://scrutinizer-ci.com/g/ttskch/esaba)[![Code Coverage](https://camo.githubusercontent.com/12ab24354528022c2514a946fcb994d6f9731b4372d57d3515eab1c146a7a9a7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7474736b63682f65736162612f6261646765732f636f7665726167652e706e67)](https://scrutinizer-ci.com/g/ttskch/esaba)[![Latest Stable Version](https://camo.githubusercontent.com/a41f4daf2228a325d479bbec0b6fc201c2f1034b7d0c8509c61f46f184447658/68747470733a2f2f706f7365722e707567782e6f72672f7474736b63682f65736162612f76657273696f6e3f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/ttskch/esaba)[![Total Downloads](https://camo.githubusercontent.com/50ec4960d7da54b793bce4dc49fe8695f55eec71d62db4ac0ba27a8cc04873cf/68747470733a2f2f706f7365722e707567782e6f72672f7474736b63682f65736162612f646f776e6c6f6164733f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/ttskch/esaba)

esabaとは
-------

[](#esabaとは)

[esa.io](https://esa.io) 上の記事データをホストするためのPHP製のWebアプリケーションです。`/post/{記事ID}` というURLでesa.io上の任意の記事を公開できます。

esa.ioesaba (デフォルトのcss)[![](https://camo.githubusercontent.com/7148897a791f6ecdbe5b06af7181b16ce163ea8b8f9dc72d210f6a88a9486f2c/68747470733a2f2f747661312e73696e61696d672e636e2f6c617267652f3030386933736b4e67793167796b387577786e7a316a333171663075307137652e6a7067)](https://camo.githubusercontent.com/7148897a791f6ecdbe5b06af7181b16ce163ea8b8f9dc72d210f6a88a9486f2c/68747470733a2f2f747661312e73696e61696d672e636e2f6c617267652f3030386933736b4e67793167796b387577786e7a316a333171663075307137652e6a7067)[![](https://camo.githubusercontent.com/040447fa08f77118bd9985bb7eda2a726cd7d43f34d8805e56af9c63f542ca23/68747470733a2f2f747661312e73696e61696d672e636e2f6c617267652f3030386933736b4e67793167796b387763666766716a33316a6c3075303735732e6a7067)](https://camo.githubusercontent.com/040447fa08f77118bd9985bb7eda2a726cd7d43f34d8805e56af9c63f542ca23/68747470733a2f2f747661312e73696e61696d672e636e2f6c617267652f3030386933736b4e67793167796b387763666766716a33316a6c3075303735732e6a7067)esa.io標準の [記事の外部公開](https://docs.esa.io/posts/110) との違い
-------------------------------------------------------

[](#esaio標準の-記事の外部公開-との違い)

- 記事の表示に独自のcss/jsを使うことができる（scss/webpack対応）
- カテゴリやタグごとに細かく公開/非公開を設定できる
- 社内のみに公開したい場合などに便利（オンプレなのでWebサーバーレベルでアクセス制限可能）
- 記事中に他の記事へのリンクがある場合は **esabaのURLに変換して出力してくれる** ので、記事本体のURLと公開用のURLを別々に管理する必要がない

環境要件
----

[](#環境要件)

- PHP &gt;=8.0.2
- Node &gt;=12
- [Composer](https://getcomposer.org/)
- [npm](https://www.npmjs.com/)

インストール方法
--------

[](#インストール方法)

### アクセストークンの発行

[](#アクセストークンの発行)

事前に `https://{チーム名}.esa.io/user/tokens/new` にてRead権限を持った [アクセストークン](https://docs.esa.io/posts/102#%E8%AA%8D%E8%A8%BC%E3%81%A8%E8%AA%8D%E5%8F%AF) を発行しておく必要があります。

[![](https://camo.githubusercontent.com/7392b7a96640e2bc01506377a23b0e046472ccd9e9540c40d9e9f3e80a845869/68747470733a2f2f747661312e73696e61696d672e636e2f6c617267652f3030386933736b4e67793167796b393067646439366a33317a30306c34676f342e6a7067)](https://camo.githubusercontent.com/7392b7a96640e2bc01506377a23b0e046472ccd9e9540c40d9e9f3e80a845869/68747470733a2f2f747661312e73696e61696d672e636e2f6c617267652f3030386933736b4e67793167796b393067646439366a33317a30306c34676f342e6a7067)

### 任意のサーバーへのインストール

[](#任意のサーバーへのインストール)

```
$ composer create-project ttskch/esaba # automatically npm install
$ cd esaba
$ cp .env{,.local}
$ vi .env.local # tailor to your env

# and serve under ./public with your web server
```

### Herokuへのデプロイ

[](#herokuへのデプロイ)

本リポジトリをフォークするか（デプロイ先が公開されてしまってよい場合）、以下の手順にて本リポジトリのコードベースをprivateリポジトリにコピーしてください。

```
$ git clone git@github.com:ttskch/esaba.git
$ cd esaba
$ git remote set-url origin git@github.com:{user}/{repo}.git # privateリポジトリのURLをセット
$ git push
```

その上で、 `https://heroku.com/deploy?template=https://github.com/{user}/{repo}` をブラウザで開くとHerokuにデプロイできます。

[![](https://camo.githubusercontent.com/9de75d2c92d4082b6d9ffc94b790f0cecad673edac2bb599be87792497afabd6/68747470733a2f2f747661312e73696e61696d672e636e2f6c617267652f3030386933736b4e67793167796c616636377a63756a333075303261666469682e6a7067)](https://camo.githubusercontent.com/9de75d2c92d4082b6d9ffc94b790f0cecad673edac2bb599be87792497afabd6/68747470733a2f2f747661312e73696e61696d672e636e2f6c617267652f3030386933736b4e67793167796c616636377a63756a333075303261666469682e6a7067)

使い方
---

[](#使い方)

### 設定

[](#設定)

設定は `.env.local` または `config/esaba.php` で行います。

#### 最小限の設定

[](#最小限の設定)

```
# .env.local

ESA_TEAM_NAME={チーム名}
ESA_ACCESS_TOKEN={アクセストークン}

```

#### アクセス制限

[](#アクセス制限)

カテゴリ/タグに応じて公開/非公開を設定することができます。設定値はJSON形式の文字列とする必要があり `.env.local` ではエスケープなどが面倒なので、`config/esaba.php` で設定するのがおすすめです。

```
