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

add ability to include custom javascript and css files. #1088

Open
azjezz opened this issue Dec 22, 2022 · 3 comments
Open

add ability to include custom javascript and css files. #1088

azjezz opened this issue Dec 22, 2022 · 3 comments

Comments

@azjezz
Copy link

azjezz commented Dec 22, 2022

It would nice to allow developer to customize their documentation using javascript and css.

two new configuration entries would be needed for this:

  1. scripts:
scripts:
  - 'path/to/my_script.js'
  1. styles:
styles:
  - 'path/to/my_style.css'

If a path points to a file in the filesystem, a copy should be made to assets/, if it's a url
it should be used as is.

@azjezz
Copy link
Author

azjezz commented Dec 22, 2022

this would allow people to include things like https://highlightjs.org to highlight code that is in the phpdoc, e.g:

<?php

namespace Useless;

/**
 * This function does nothing!
 * 
 * Example:
 *
 * ```php
 * use function Useless\foo;
 * 
 * foo(); // does absolutely nothing!
 * ```
 */
function foo(): void {}

@ondrejmirtes
Copy link

I think you can already do this. ApiGen has a theming ability. See how I was able to add a tracking code: phpstan/phpstan-src@c839382

Related issue: #1077

@azjezz
Copy link
Author

azjezz commented Dec 22, 2022

nice! that solves my problem, but i think having this done dynamic in the config without creating a theme directory and having to manually copy the assets is better, so I'll keep this issue open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants