taeluf/stories

v0.1.x-dev 2022-04-17 07:42 UTC

This package is auto-updated.

Last update: 2024-09-28 07:24:25 UTC


README

故事

撰写新闻故事和轻松分享故事的后端软件。

这是全新的测试版软件,文档不足,实现细节将会改变。

安装

composer require taeluf/stories v0.1.x-dev   

或在您的 composer.json 文件中

{"require":{ "taeluf/stories": "v0.1.x-dev"}}  

入门指南

您创建一个 Stories 目录,然后在该目录下为每个您要写的文章创建一个子目录。然后对于每个文章,您需要实例化一个文章对象 ... 目前为止。

示例交付脚本

<?php  
  
require(__DIR__.'/../../vendor/autoload.php');  
  
$lia = new \Lia();  
  
$main = \Lia\Package\Server::main($lia);  
  
  
$cmark = new \Lia\Addon\CommonMark($main);  
$story = new \Tlf\Story(__DIR__.'/Stories/sample1/', $lia, '/sample1/');  
$story->cmark = $cmark;  
  
  
// $lia->dump();  
  
  
  
$story->setup();  
  
// $stories = new \Tlf\Stories();  
// $stories->enable_lia($lia, '/stories/');  
//  
// $stories->add_dir(__DIR__.'/Stories/');  
  
  
$lia->deliver();  

查看其余的故事文件在 test/Server/Stories/sample1/

Stories/sample1/story.php:

<?=$this->toc();?>  
  
<?=$this->story('main');?>  
  
<?=$this->story('background');?>  
  
<?=$this->story('inline-image');?>  
  
<?=$this->details('terms', 'Terminology');?>  
  
## File Downloads  
See [File Downloads](files/)  
  
<?=$this->sources()?>  

Stories/sample1/story/main.md:

# Title  
This story isn't about anything at all. It's literally not about anything.