reuters-graphics / bluprint_graphics-rig Goto Github PK
View Code? Open in Web Editor NEWHome of The Rig.
Home of The Rig.
We're onboarding folks to Sveltekit with a bit of pace now.
I think I want to take the opportunity to deprecate some of the more complicated features in this rig for non-standard projects that are better handled by the new kit.
Thinking:
Would also love to move more out of the bin in favour of functions in graphics-bin and ultimately use graphics-kit-publisher for all publishing logic.
So Jon, i'm writing this as bookkeeping so i remember what this was when you are back
in bin/graphicsServer/index.js
this logic test:
if (updateOnly) {
await graphic.updateGraphicEditions();
} else if (createOnly) {
await graphic.createGraphicEditions();
// This else shouldn't ever run b/c we always call w/ args
} else {
await graphic.createGraphicEditions();
await graphic.updateGraphicEditions();
}
is resolving on the createOnly option.
then in graphicPack.js it's going to end in THIS function
async createPack() {
if (this.graphicId) return;
this.client = new ServerClient(this.credentials);
await this.client.createGraphic(this.metadata);
this.graphicId = this.client.graphic.id;
setPkgProp('reuters.graphicId', this.graphicId);
}
that will test for this.graphicId, find one and just return
So when you get to the createEditions function in that file, you will come to this line, which expects a this.client
const editions = await this.client.createEditions(`${locale}.zip`, fileBuffer, this.editions.metadata);
but you will not have one, because createPack just returned. You need the logic of the updatePack function to have run:
const { username, password, apiKey } = this.credentials;
this.client = new ServerClient({
username,
password,
apiKey,
graphic: {
id: this.graphicId,
},
});
await this.client.updateGraphic(this.metadata);
i couldn't figure out how the arguments in index.js were being passed in to adjust for this scenario, so to fudge i just dumped the updatePack lines into the createEditions function, but i'm sure there is a simpler way to adjust the logic test in index.js.
So Gurman found a nifty bug...
She was trying to add some custom methods onto the d3 global.
import * as d3 from 'd3';
d3.selection.prototype.newMethod = () => ...
newMethod
would work in dev but with a warning. But when we built, it was gone.
The solution was to explicitly import the node build of d3:
import * as d3 from 'd3/dist/d3.node.js';
... but this feels hacky AF.
Putting this ticket here for anyone to tell me a better way...
Using the runner img-otimiser
to optimise multiple files simultaneously to specified dimensions
We should invest in a script to convert the JSON of text returned by runner get-google in conjunction with the metadata.json file to create an apple news format of articles.
this would require, to some degree, standardizing as many of the keys used in Archie as possible.
I would imagine there would be room for bespoke keys that could be ignored, but things like text, photo, headline, dek, et cetera should be pulled and formatted by default.
A default set of styles should be written and attached.
This could vastly expidite the process of building apple news versions of stories.
Attaching an example of the assets delivered for capitol mob piece.
reuters-crisis-at-the-capitol-anf.zip
Add this to style rules
body.child-frame{
.container{
width:100% !important;
padding-left:0px;
max-width:100% !important;
}
}
We should fix this up so folks are automatically getting our latest ai2html script:
https://github.com/reuters-graphics/bluprint_graphics-rig/blob/master/bin/checkAi2html/index.js
Two things, though:
Since it appears people are running more than one version of Illustrator, I think we need to walk/glob the applications directory and find ALL versions they have installed. So the SCRIPT in constants here should really be an array of locations and we'll install to all of them.
Since we'll have to enter a password each time we want to write to that directory on our managed machines, we should read the contents of the file if it already exists, and if it's the same as the latest, just skip it.
Assigning this to you @manas271196 'cause you are the involuntary king of ai2html :) but I'm around to help work out the details of the above.
Illustrator files get quite big and the server will reject files over 150mb
... rather than just seeing translations after build on preview.
Images should always have alt
attributes Decorative images like section breakers or logos should have empty alt
attributes.
Graphics sections should always have an aria-describedby
attribute linked to another element on the page with text and that ID.
Preferably check these before build and prompt for missing.
More research TK: @AditiBhandariTR
Until this is fixed. jonschlinkert/strip-comments#47
... might be a spelling issue??
API now available here:
https://api.graphics-sphinx.thomsonreuters.com/groups/v1/groups/rngs/roles/editors?skip=0&take=100
... need to create dummy editions when new locales are added. Right now this is being skipped if a pack ID is found. Need to also check for an edition ID per locale.
Also be sure not to update pack details with locale metadata.
Add a little script that's just a prompt and ticks that update date over when the user says it's an update.
... in favour of engines
key in package.json.
Also, check if we can move to Node 14+.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.