Giter Site home page Giter Site logo

ampproject / amp-by-example Goto Github PK

View Code? Open in Web Editor NEW
753.0 753.0 505.0 235.37 MB

DEPRECATED: AMP by Example has been merged into amp.dev

Home Page: http://amp.dev

License: Apache License 2.0

Go 6.74% JavaScript 15.00% HTML 74.13% CSS 3.79% Shell 0.24% Dockerfile 0.10%
amp amp-html

amp-by-example's Issues

Split examples into sections

To give a better overview over the samples, we could split the samples into sections in the overview page, e.g.:

  1. Introduction
    • Hello World
    • ...
  2. Components
    • amp-img
    • amp-carousel
    • ....
  3. Getting more out of AMP
    • Video Carousel
    • How to cope with the fixed carousel height?
    • User notifications with server end-point
    • ...

Implementation wise this is simple by moving the samples into respective directories.

//cc @adewale @juliantoledo @jkingyens @ymotongpoo @kul3r4 what do you think?

amp-accordion example does'nt work!

Powered by AMP ⚡ HTML – Version 1456954860788
AMP validation had errors:
https://ampbyexample.com/components/amp-accordion/:5:2 The attribute 'custom-element' in tag 'amp-access extension .js script' is set to the invalid value 'amp-accordion'. (see https://www.ampproject.org/docs/reference/extended/amp-access.html)
https://ampbyexample.com/components/amp-accordion/:1570:12 The tag 'amp-accordion' is disallowed.
https://ampbyexample.com/components/amp-accordion/:1571:4 The attribute 'expanded' may not appear in tag 'section'.
https://ampbyexample.com/components/amp-accordion/:1653:2 The tag 'amp-accordion' is disallowed.

Support code sections in docs

Using code sections in docs with triple ''' does not keep the indentation.
Example is: amp-list where the json inside the docs is not correctly indented.

Mark experimental samples

[] append [experimental] to example name in overview page
[] inject src/templates/experiment.html into example template if experimental flag is set (see #32)

Validation fails with timeout

[15:24:52] Validating example components/amp-ad/index.html: PASS
undefined:1
Fatal Error: Timeout: did not get to load all resources on this page
^

SyntaxError: Unexpected token F
    at Object.parse (native)
    at ChildProcess.<anonymous> (/Users/sbenz/Documents/projects/amp-by-example-dev/tasks/validate-example.js:63:37)
    at emitTwo (events.js:100:13)
    at ChildProcess.emit (events.js:185:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)

@jkingyens have you seen this before?

Shorten text in code sections

Long texts in the sample files is often required (e.g. amp-carousel), but bloats the code sections. Let's automatically shorten text between html tags that is longer than 50 chars, e.g.

<p>
  This is a very very very very very very very very very veryvery very very long text
</p>

becomes:

<p>
  This is a very very very very very very very ...
</p>

validate-example: mark ignored samples

Can we include ignored samples (skipValidation / experimental) in the validation report? e.g.:

Validating components/amp-list/index.html: IGNORED (in yellow)

It is any way to start with AJAX or custome event ??

Hello,

I am starting with AMP for my site Need to know that we can not use AJAX ??

AND one more issue which i am getting on development

If i am adding script like this
<script async src=https://cdn.ampproject.org/v0.js></script> -IT's fine
But If i download that script and try to add like,<script async src=folderPAth/v0.js></script>
AMP Validation ERROR Why ??

Add description to sections

Create a file section.json in each section dir which includes the description. Generate it automatically when running gulp create with a new section.

{
  "description": "This is my section"
}

Make anchor links order independent

Currently anchor links depend on the order (example1, example2,...). These will break if a new section is added in between. We should use a slugged version of the content instead.

Add metadata to examples

Make it possible to add metadata to examples via special comment tag, e.g.

<!---{ 
  experiment: true,
  component: amp-accordion
}--->

Metadata can contain arbitrary JSON. The DocumentParser should extract the metadata and add it to a new field in Document.

This is the foundation for:

  • #33 marking experimental samples
  • #1 don't validate experimental samples

//cc @jkingyens @juliantoledo does anyone of you want to tackle this?

SAMPLES_DIR is missing at gulpfile.js

[21:40:56] 'compile:sitemap' errored after 186 μs
[21:40:56] ReferenceError: SAMPLES_DIR is not defined
at Gulp. (/Users/jtoledo/Documents/workspace/amp-by-example/gulpfile.js:167:19)
at module.exports (/Users/jtoledo/Documents/workspace/amp-by-example/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/Users/jtoledo/Documents/workspace/amp-by-example/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/Users/jtoledo/Documents/workspace/amp-by-example/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/Users/jtoledo/Documents/workspace/amp-by-example/node_modules/orchestrator/index.js:134:8)
at /usr/local/lib/node_modules/gulp/bin/gulp.js:129:20
at nextTickCallbackWith0Args (node.js:452:9)
at process._tickCallback (node.js:381:13)
at Function.Module.runMain (module.js:449:11)
at startup (node.js:139:18)

Create an example that shows all the video types in AMP

The list includes (at least):

  • amp-video
  • amp-instagram pointing at a video
  • amp-vine
  • amp-youtube
  • amp-vimeo
  • amp-dailymotion
  • amp-twitter pointing at a Twitter-native video
  • amp-facebook pointing at a Facebook-native video
  • amp-brightcove
  • a non-natively supported video platform via amp-iframe

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.