GithubHelp home page GithubHelp logo

silverstripe / api.silverstripe.org Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 14.0 1.74 MB

API documentation for the Silverstripe Framework

License: BSD 3-Clause "New" or "Revised" License

CSS 2.05% PHP 79.77% Shell 0.66% HTML 2.27% Twig 15.25%

api.silverstripe.org's People

Contributors

andrewandante avatar camfindlay avatar chillu avatar dependabot[bot] avatar dhensby avatar edlinklater avatar emteknetnz avatar fspringveldt avatar guysartorelli avatar jakedaleweb avatar mandrew avatar maxime-rainville avatar nightjar avatar robbieaverill avatar sabina-talipova avatar samthejarvis avatar simonwelsh avatar ss23 avatar undefinedoffset avatar williamdes avatar wilr avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

api.silverstripe.org's Issues

/search/lookup URLs broken

From @SpiritLevel

The parsing of [api:Director] style short codes seems to be generating the correct query:
api.silverstripe.org/search/lookup/?q=Director&version=3&module=framework
The problem is that the api site no longer processes such queries. These queries used to work :(

API SAMI Add canonical urls to all pages

After the migration to sami there was an issue adding canonical urls;

This is the code I was using

<link rel="canonical"
    href="{{ project.config('base_url')|replace({'%version%': project.version.name}) }}/{{ uri }}"
/>

Since documents are cached between versions (e.g. 4, master, 3) it's not possible to render version-specific canonical urls, since it pollutes other versions.

I've tracked the code which pollutes the cache to Project::renderVersion

if ($previous && !$this->renderer->isRendered($this)) {
    $this->seedCache($previous, $this->getBuildDir());
}

However, removing this line causes so much extra work the task runs out of memory and crashes, so it needs to be left in for now.

Swapping version numbers doesn't keep you at the API you're looking at

When you're looking at some API, and then swap versions, it kicks you back up to the namespaces page instead of showing you the new version of the API you were looking at.

e.g.

  1. go to https://api.silverstripe.org/4/SilverStripe/CMS/Model/SiteTree.html
  2. swap to "5.x"
  3. You should be taken to https://api.silverstripe.org/5/SilverStripe/CMS/Model/SiteTree.html but instead you're taken to https://api.silverstripe.org/5/index.html

PRs

Task: Migration to php7 / new backend

In preparation for release of SilverStripe 4 a major upgrade of api.silverstripe.org will be necessary. Given the range of options it's likely we'll move away from ApiGen to another backend, shifting the hosting to SilverStripe platform, and upgrade to PHP7.

Tasks:

Slow image deletion

Load a lot of images into the assets into a subfolder/ subfolders
In the Files interface select the folder(s) and "delete" them
Wait. Wait....

I would extensively test this but I have been waiting 40 minutes for the process to finish.

Too much repeating info

From silverstripe/silverstripe-framework#7625

Method summary & method elaboration shows no major differences (might as well link me to the source code like the old doc)
Too much repeating information in one page.

@tractorcow said: "Maybe regarding 6. / 8. we could restructure the summary / elaboration... clicking the summary "expands" the elaboration directly below, similar to an accordion. @clarkepaul what do you think about this?"

Search is non-functional, and the auto-completer also ceases to work at search.html

Behold the results:
http://api.silverstripe.org/4/search.html?search=DataObject
Please also note the non-functional auto-completer in the top-left
And that the adblocker is disabled (top right)

image

Loading the site on index.php sees the auto-completer begin functioning again

image

Search page is reached by submitting the auto-completer input
type "DataObject" then press enter; although auto-completions exist and are valid, the fact there are more than one matches means it goes to the results page, which then shows no results.

Invalid docblock syntax breaking Datetime.Format API docs

Affected Version

SS 4.3

Description

DateTime.Format in a template used to work fine, now gives broken results like 16/33/2018
The date is correctly stored in the database and is correctly retrieved if dumped in PHP before used in template.

Steps to Reproduce

Give the template a datetime from the database and call Format on it in the template code.

The documentation on api.silverstripe.org gives nothing but the format string as an explanation for the format parameter (in fact not even that, it's just described as that in a side sentence for the function itself).
Obviously proper format strings that are well known and which people are used to don't work.
One has to Google for the issue (after figuring out the display is what's broken), then find a Stackoverflow Question that then links some ominous changelog which contains some remote mention of it in one of its thousands of lines... Then you have to Google the format to actually find any helpful information.
That's like 10 steps, where one should suffice. Took me like an hour to find the necessary information to change a few characters in the template...

This is ridiculous BS, really pissed off....

Update api docs PHP from 7.3 to 8.1

This thing is still running on PHP 7.3!

Update it to PHP 8.1. This is hosted in silverstripe cloud so we know the hosting can support it.

Prs

NOTE: Once this has been merged, either deploy it to ssapi2 or reassign to Guy to do that.

Master docs won't render due to ::class bug

There is now a bug with the MASTER docs where an error:

The TokenReflection library threw an exception while parsing the file

Occurs when parsing a file using the MyClass::class syntax - which is all over SS4. See ApiGen/ApiGen#680 for the issue. There are two ways to solve this: either use the fork of the token reflection: ApiGen/ApiGen#680 (comment) or upgrade to the unstable 5.0.0-rc5 (and PHP7.1).

BUG SAMI tags in comments aren't sanitised

See http://api.silverstripe.org/4/SilverStripe/Forms/DropdownField.html

image

The phpdoc for the DropdownField class contains the line Dropdown field, created from a <select> tag. an actual tag is rendered, throwing off the whole page. This can be worked around by using &lt;select&gt; instead - which means that either:

a) the content needs to be sanitised before rendered - see https://github.com/FriendsOfPHP/Sami/issues/261
b) we need to check all our classes for tags and update/remove them accordingly

GlobalNav Search Broken

Recently we updated the SilverStripe.com and SilverStripe.org search from Google Custom Search to Swiftype. The CSS now references a Swiftype specific search input and the JS for Google has been replaced with Swiftype JS. This has broken the GlobalNav search (the search bar that is displayed when you click the search icon in the nav in the top right).

I believe the fix may be to replace the following lines:
https://github.com/silverstripe/api.silverstripe.org/blob/master/conf/themes/silverstripe/layout/layout.twig#L48-L51

With:

        <div id="swiftype-search">
            <div class="swiftype-control-searchbox-only" dir="ltr">
                <form class="swiftype-search-box" accept-charset="utf-8">
                    <table cellspacing="0" cellpadding="0" class="swiftype-search-box">
                        <tbody><tr><td class="swiftype-input">
                            <input autocomplete="off" type="text" size="10" class="swiftype-input" name="search" title="search" dir="ltr" spellcheck="false" style="outline: none;" placeholder="Search SilverStripe...">
                        </td>
                            <td class="swiftype-search-button"><input type="submit" value="Search" class="swiftype-search-button" title="search"></td>
                            <td class="swiftype-clear-button"><div class="swiftype-clear-button" title="clear results">&nbsp;</div></td>
                        </tr></tbody>
                    </table>
                </form>
            </div>
        </div>

Improve mobile view

The site looks bad on mobile (I can’t paste a screenshot from my phone right now though)

Config reference

This is a bit more of a starting point of the conversation we'd like to have for "how do we document config?". At the moment the configuration system is a critical feature of the silverstripe framework API, and the actual configurable options lack any real formal documentation.

My suggestion would be to leverage the @config phpdoc identifier to build a list of configurable elements.

For instance, if I go to http://api.silverstripe.org/3.1/class-Director.html I would probably benefit from a "list of configurable options" section.

https: toolbar still not working.

Seems there has been PRs to fix this though unsure if it's been deployed yet. The toolbar still seems broken under ssl on the current live site.

Feedback from API generator change

First, let me say thanks and great job on switching to SAMI so quickly!

However, there has been strong feedback from the community with regards to the new layout of the docs. Below is a summary of the features that are now missing, in a different place or otherwise disliked:

    • The native methods of the object are at the bottom, rather than pride-of-place at the top (#60)
    • The amount of noise from inherited methods and the sheer amount of space it takes up on a page are off-putting and often lead to developers giving up (#62)
    • A specific documentation integration - Dash - no longer works
    • A link to the file that contains the class is no longer present - I assume a link to GitHub would be acceptable in this case (#59)

It seems to me that most of this is templating rather than fundamental changes to the code.

Link to github in footer

We do this on docs as well. Without that link, people don't know where to report bugs, and realise they can actually help fixing them ;)

Searching for a class that is a suffix of another class, where the class you want comes alphabetically after the longer version, brings up unwanted results

Trying to bring up the documentation for TimeClass, will instead search for anything with TimeClass, meaning that DateTimeClass will come up first. In the case where the thing you're searching for is a prefix you can simply append a ::, however, this is not possible when it's a suffix that I'm aware of.

Expect results would probably be either a special identifier to signify start of the class name (think a regex style ^TimeClass, or mix and match the results from any search to not be alphabetical (that is, when you search for TimeClass, display a mix of results from both DateTimeClass and TimeClass, giving you a better chance of finding the results you will find helpful.

api.silverstripe.org only has core modules

https://api.silverstripe.org/5/index.html

Only lists core (installer?) modules

It should list all supported modules (sink)

Means that heaps of api links in our changelogs for sink modules go nowhere e.g. CWP\CWP\Extensions\CwpSiteSummaryExtension (which is deprecated, though should still show in the 4 branch on api docs)

Stretch Goal

We mainly care about this for CMS5. If it's possible and easy to do it both for CMS4 and CMS5, do it. Otherwise, CMS5 is the priority.

PRs

Please take care to validate each of the branch mappings for each version! There are weird scenarios where it jumps a major release or where the same major release is available across multiple CMS versions. It is very likely I missed something.

4.x API - docs inconsistent with current release

The API docs seem to be showing an inconsistency in the versions of released code.

eg.
If you install the current Silverstripe stable (4.0.3) as per the instructions, you'll get v1.0.3 of silverstripe/asset-admin

The 4.x API docs are currently showing code from what looks like the v1.1 branch (possibly this is also the master). There are differences in the methods / properties between the two branches, so you end up with the documentation being misleading compared to the stable release.

If you install the 4.1.0-rc2 branch of Silverstripe, you get the higher version of asset-admin which matches the API docs

As the 4.1 branch comes online, and runs in parallel with the 4.0 branch, there will presumably be more occurrences of this as the various dependencies may diverge between the two.

Should the documentation be further broken down to 4.0.x and 4.1.x to avoid this happening in the future?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.